diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb index efa1491729..6f7f40319a 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb @@ -226,9 +226,6 @@ def make_request_async(method, path, options = {}) fail ArgumentError, 'path is nil' if path.nil? request_url = options[:base_url] || @base_url - if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) - @request_headers['Content-Type'] = options[:headers]['Content-Type'] - end request_headers = @request_headers request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? @@ -245,7 +242,9 @@ def make_request_async(method, path, options = {}) # def add_telemetry sdk_information = 'azure_mgmt_api_management' - sdk_information = "#{sdk_information}/0.17.0" + if defined? Azure::ApiManagement::Mgmt::V2016_07_07::VERSION + sdk_information = "#{sdk_information}/#{Azure::ApiManagement::Mgmt::V2016_07_07::VERSION}" + end add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_management_services.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_management_services.rb index e2292c5b18..62cfa0875b 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_management_services.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_management_services.rb @@ -36,8 +36,8 @@ def initialize(client) # # @return [ApiManagementServiceResource] operation results. # - def manage_deployments(resource_group_name, service_name, parameters, custom_headers:nil) - response = manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def manage_deployments(resource_group_name, service_name, parameters, custom_headers = nil) + response = manage_deployments_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -52,9 +52,9 @@ def manage_deployments(resource_group_name, service_name, parameters, custom_hea # @return [Concurrent::Promise] promise which provides async access to http # response. # - def manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:nil) + def manage_deployments_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -84,8 +84,8 @@ def manage_deployments_async(resource_group_name, service_name, parameters, cust # # @return [ApiManagementServiceResource] operation results. # - def restore(resource_group_name, service_name, parameters, custom_headers:nil) - response = restore_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def restore(resource_group_name, service_name, parameters, custom_headers = nil) + response = restore_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -100,9 +100,9 @@ def restore(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def restore_async(resource_group_name, service_name, parameters, custom_headers:nil) + def restore_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_restore_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_restore_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -132,8 +132,8 @@ def restore_async(resource_group_name, service_name, parameters, custom_headers: # # @return [ApiManagementServiceResource] operation results. # - def backup(resource_group_name, service_name, parameters, custom_headers:nil) - response = backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def backup(resource_group_name, service_name, parameters, custom_headers = nil) + response = backup_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -148,9 +148,9 @@ def backup(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def backup_async(resource_group_name, service_name, parameters, custom_headers:nil) + def backup_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_backup_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -179,8 +179,8 @@ def backup_async(resource_group_name, service_name, parameters, custom_headers:n # # @return [ApiManagementServiceResource] operation results. # - def create_or_update(resource_group_name, service_name, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -197,8 +197,8 @@ def create_or_update(resource_group_name, service_name, parameters, custom_heade # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -214,24 +214,22 @@ def create_or_update_with_http_info(resource_group_name, service_name, parameter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiManagementServiceResource.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -300,8 +298,8 @@ def create_or_update_async(resource_group_name, service_name, parameters, custom # # @return [ApiManagementServiceResource] operation results. # - def update(resource_group_name, service_name, parameters, custom_headers:nil) - response = update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -316,9 +314,9 @@ def update(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def update_async(resource_group_name, service_name, parameters, custom_headers:nil) + def update_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_update_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -344,8 +342,8 @@ def update_async(resource_group_name, service_name, parameters, custom_headers:n # # @return [Object] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -359,8 +357,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -373,18 +371,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -449,8 +443,8 @@ def get_async(resource_group_name, service_name, custom_headers:nil) # # @return [ErrorResponse] operation results. # - def delete(resource_group_name, service_name, custom_headers:nil) - response = delete_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, custom_headers = nil) + response = delete_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -464,8 +458,8 @@ def delete(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, custom_headers:nil) - delete_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, custom_headers = nil) + delete_async(resource_group_name, service_name, custom_headers).value! end # @@ -478,18 +472,14 @@ def delete_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, custom_headers:nil) + def delete_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -543,8 +533,8 @@ def delete_async(resource_group_name, service_name, custom_headers:nil) # # @return [Array] operation results. # - 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) + def list_by_resource_group(resource_group_name, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers) first_page.get_all_items end @@ -557,8 +547,8 @@ def list_by_resource_group(resource_group_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - 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! + def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) + list_by_resource_group_async(resource_group_name, custom_headers).value! end # @@ -570,14 +560,13 @@ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_resource_group_async(resource_group_name, custom_headers:nil) + 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, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -630,8 +619,8 @@ def list_by_resource_group_async(resource_group_name, custom_headers:nil) # # @return [Array] operation results. # - def list(custom_headers:nil) - first_page = list_as_lazy(custom_headers:custom_headers) + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) first_page.get_all_items end @@ -643,8 +632,8 @@ def list(custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_with_http_info(custom_headers:nil) - list_async(custom_headers:custom_headers).value! + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! end # @@ -655,13 +644,12 @@ def list_with_http_info(custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_async(custom_headers:nil) + def list_async(custom_headers = nil) fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -717,8 +705,8 @@ def list_async(custom_headers:nil) # # @return [ApiManagementServiceGetSsoTokenResult] operation results. # - def get_sso_token(resource_group_name, service_name, custom_headers:nil) - response = get_sso_token_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_sso_token(resource_group_name, service_name, custom_headers = nil) + response = get_sso_token_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -733,8 +721,8 @@ def get_sso_token(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_sso_token_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_sso_token_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_sso_token_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_sso_token_async(resource_group_name, service_name, custom_headers).value! end # @@ -748,18 +736,14 @@ def get_sso_token_with_http_info(resource_group_name, service_name, custom_heade # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_sso_token_async(resource_group_name, service_name, custom_headers:nil) + def get_sso_token_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -814,8 +798,8 @@ def get_sso_token_async(resource_group_name, service_name, custom_headers:nil) # # @return [ApiManagementServiceNameAvailabilityResult] operation results. # - def check_name_availability(parameters, custom_headers:nil) - response = check_name_availability_async(parameters, custom_headers:custom_headers).value! + def check_name_availability(parameters, custom_headers = nil) + response = check_name_availability_async(parameters, custom_headers).value! response.body unless response.nil? end @@ -829,8 +813,8 @@ def check_name_availability(parameters, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def check_name_availability_with_http_info(parameters, custom_headers:nil) - check_name_availability_async(parameters, custom_headers:custom_headers).value! + def check_name_availability_with_http_info(parameters, custom_headers = nil) + check_name_availability_async(parameters, custom_headers).value! end # @@ -843,19 +827,20 @@ def check_name_availability_with_http_info(parameters, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def check_name_availability_async(parameters, custom_headers:nil) + def check_name_availability_async(parameters, custom_headers = nil) fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiManagementServiceCheckNameAvailabilityParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -915,8 +900,8 @@ def check_name_availability_async(parameters, custom_headers:nil) # # @return [CertificateInformation] operation results. # - def upload_certificate(resource_group_name, service_name, parameters, custom_headers:nil) - response = upload_certificate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def upload_certificate(resource_group_name, service_name, parameters, custom_headers = nil) + response = upload_certificate_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -933,8 +918,8 @@ def upload_certificate(resource_group_name, service_name, parameters, custom_hea # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def upload_certificate_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - upload_certificate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def upload_certificate_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + upload_certificate_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -950,24 +935,22 @@ def upload_certificate_with_http_info(resource_group_name, service_name, paramet # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def upload_certificate_async(resource_group_name, service_name, parameters, custom_headers:nil) + def upload_certificate_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiManagementServiceUploadCertificateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1028,8 +1011,8 @@ def upload_certificate_async(resource_group_name, service_name, parameters, cust # # @return [ApiManagementServiceResource] operation results. # - def update_hostname(resource_group_name, service_name, parameters, custom_headers:nil) - response = update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def update_hostname(resource_group_name, service_name, parameters, custom_headers = nil) + response = update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1044,9 +1027,9 @@ def update_hostname(resource_group_name, service_name, parameters, custom_header # @return [Concurrent::Promise] promise which provides async access to http # response. # - def update_hostname_async(resource_group_name, service_name, parameters, custom_headers:nil) + def update_hostname_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -1077,8 +1060,8 @@ def update_hostname_async(resource_group_name, service_name, parameters, custom_ # # @return [ApiManagementServiceResource] operation results. # - def begin_manage_deployments(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_manage_deployments(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1097,8 +1080,8 @@ def begin_manage_deployments(resource_group_name, service_name, parameters, cust # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_manage_deployments_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_manage_deployments_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1116,24 +1099,22 @@ def begin_manage_deployments_with_http_info(resource_group_name, service_name, p # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiManagementServiceManageDeploymentsParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1194,8 +1175,8 @@ def begin_manage_deployments_async(resource_group_name, service_name, parameters # # @return [ApiManagementServiceResource] operation results. # - def begin_restore(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_restore_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_restore(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_restore_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1213,8 +1194,8 @@ def begin_restore(resource_group_name, service_name, parameters, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_restore_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_restore_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_restore_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_restore_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1231,24 +1212,22 @@ def begin_restore_with_http_info(resource_group_name, service_name, parameters, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_restore_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_restore_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiManagementServiceBackupRestoreParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1309,8 +1288,8 @@ def begin_restore_async(resource_group_name, service_name, parameters, custom_he # # @return [ApiManagementServiceResource] operation results. # - def begin_backup(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_backup(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_backup_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1328,8 +1307,8 @@ def begin_backup(resource_group_name, service_name, parameters, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_backup_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_backup_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_backup_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1346,24 +1325,22 @@ def begin_backup_with_http_info(resource_group_name, service_name, parameters, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_backup_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_backup_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiManagementServiceBackupRestoreParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1422,8 +1399,8 @@ def begin_backup_async(resource_group_name, service_name, parameters, custom_hea # # @return [ApiManagementServiceResource] operation results. # - def begin_update(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_update_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1439,8 +1416,8 @@ def begin_update(resource_group_name, service_name, parameters, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_update_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_update_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1455,24 +1432,22 @@ def begin_update_with_http_info(resource_group_name, service_name, parameters, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_update_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_update_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiManagementServiceBaseParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1533,8 +1508,8 @@ def begin_update_async(resource_group_name, service_name, parameters, custom_hea # # @return [ApiManagementServiceResource] operation results. # - def begin_update_hostname(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_update_hostname(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1552,8 +1527,8 @@ def begin_update_hostname(resource_group_name, service_name, parameters, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_update_hostname_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_update_hostname_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1570,24 +1545,22 @@ def begin_update_hostname_with_http_info(resource_group_name, service_name, para # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiManagementServiceUpdateHostnameParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1644,8 +1617,8 @@ def begin_update_hostname_async(resource_group_name, service_name, parameters, c # # @return [ApiManagementServiceListResult] operation results. # - 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! + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -1659,8 +1632,8 @@ def list_by_resource_group_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - 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! + 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).value! end # @@ -1673,12 +1646,11 @@ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_resource_group_next_async(next_page_link, custom_headers:nil) + 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 @@ -1732,8 +1704,8 @@ def list_by_resource_group_next_async(next_page_link, custom_headers:nil) # # @return [ApiManagementServiceListResult] operation results. # - def list_next(next_page_link, custom_headers:nil) - response = list_next_async(next_page_link, custom_headers:custom_headers).value! + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -1747,8 +1719,8 @@ def list_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_next_with_http_info(next_page_link, custom_headers:nil) - list_next_async(next_page_link, custom_headers:custom_headers).value! + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! end # @@ -1761,12 +1733,11 @@ def list_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_next_async(next_page_link, custom_headers:nil) + 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 @@ -1820,12 +1791,12 @@ def list_next_async(next_page_link, custom_headers:nil) # @return [ApiManagementServiceListResult] which provide lazy access to pages # of the response. # - 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! + def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, 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) + list_by_resource_group_next_async(next_page_link, custom_headers) end page end @@ -1840,12 +1811,12 @@ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil) # @return [ApiManagementServiceListResult] which provide lazy access to pages # of the response. # - def list_as_lazy(custom_headers:nil) - response = list_async(custom_headers:custom_headers).value! + def list_as_lazy(custom_headers = nil) + response = list_async(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) + list_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_operations.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_operations.rb index f3e85ef535..93b018953b 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_operations.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_operations.rb @@ -42,8 +42,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_api(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_api(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -68,8 +68,8 @@ def list_by_api(resource_group_name, service_name, api_id, filter:nil, top:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_api_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! end # @@ -93,24 +93,15 @@ def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_api_async(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_api_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -169,8 +160,8 @@ def list_by_api_async(resource_group_name, service_name, api_id, filter:nil, top # # @return [OperationContract] operation results. # - def get(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! response.body unless response.nil? end @@ -188,8 +179,8 @@ def get(resource_group_name, service_name, api_id, operation_id, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) - get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! end # @@ -206,26 +197,16 @@ def get_with_http_info(resource_group_name, service_name, api_id, operation_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) + def get_async(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -284,8 +265,8 @@ def get_async(resource_group_name, service_name, api_id, operation_id, custom_he # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers).value! nil end @@ -304,8 +285,8 @@ def create_or_update(resource_group_name, service_name, api_id, operation_id, pa # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers).value! end # @@ -323,32 +304,24 @@ def create_or_update_with_http_info(resource_group_name, service_name, api_id, o # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::OperationContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -402,8 +375,8 @@ def create_or_update_async(resource_group_name, service_name, api_id, operation_ # will be added to the HTTP request. # # - def update(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! nil end @@ -425,8 +398,8 @@ def update(resource_group_name, service_name, api_id, operation_id, parameters, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! end # @@ -447,20 +420,11 @@ def update_with_http_info(resource_group_name, service_name, api_id, operation_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -468,13 +432,14 @@ def update_async(resource_group_name, service_name, api_id, operation_id, parame request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::PatchParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -527,8 +492,8 @@ def update_async(resource_group_name, service_name, api_id, operation_id, parame # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! nil end @@ -549,8 +514,8 @@ def delete(resource_group_name, service_name, api_id, operation_id, if_match, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! end # @@ -570,27 +535,17 @@ def delete_with_http_info(resource_group_name, service_name, api_id, operation_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -636,8 +591,8 @@ def delete_async(resource_group_name, service_name, api_id, operation_id, if_mat # # @return [OperationCollection] operation results. # - def list_by_api_next(next_page_link, custom_headers:nil) - response = list_by_api_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_api_next(next_page_link, custom_headers = nil) + response = list_by_api_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -651,8 +606,8 @@ def list_by_api_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_api_next_with_http_info(next_page_link, custom_headers:nil) - list_by_api_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_api_next_with_http_info(next_page_link, custom_headers = nil) + list_by_api_next_async(next_page_link, custom_headers).value! end # @@ -665,12 +620,11 @@ def list_by_api_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_api_next_async(next_page_link, custom_headers:nil) + def list_by_api_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 @@ -736,12 +690,12 @@ def list_by_api_next_async(next_page_link, custom_headers:nil) # @return [OperationCollection] which provide lazy access to pages of the # response. # - def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_api_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_api_next_async(next_page_link, custom_headers:custom_headers) + list_by_api_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_products.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_products.rb index ca5eb25c97..6bee552064 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_products.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/api_products.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_api(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_api(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_api(resource_group_name, service_name, api_id, filter:nil, top:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_api_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! end # @@ -87,24 +87,15 @@ def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_api_async(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_api_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -159,8 +150,8 @@ def list_by_api_async(resource_group_name, service_name, api_id, filter:nil, top # # @return [ProductCollection] operation results. # - def list_by_api_next(next_page_link, custom_headers:nil) - response = list_by_api_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_api_next(next_page_link, custom_headers = nil) + response = list_by_api_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -174,8 +165,8 @@ def list_by_api_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_api_next_with_http_info(next_page_link, custom_headers:nil) - list_by_api_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_api_next_with_http_info(next_page_link, custom_headers = nil) + list_by_api_next_async(next_page_link, custom_headers).value! end # @@ -188,12 +179,11 @@ def list_by_api_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_api_next_async(next_page_link, custom_headers:nil) + def list_by_api_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 @@ -257,12 +247,12 @@ def list_by_api_next_async(next_page_link, custom_headers:nil) # @return [ProductCollection] which provide lazy access to pages of the # response. # - def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_api_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_api_next_async(next_page_link, custom_headers:custom_headers) + list_by_api_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/apis.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/apis.rb index d86b93c6ec..36322450f0 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/apis.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/apis.rb @@ -41,8 +41,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -66,8 +66,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -90,20 +90,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -160,8 +154,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [ApiContract] operation results. # - def get(resource_group_name, service_name, api_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, api_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, custom_headers).value! response.body unless response.nil? end @@ -177,8 +171,8 @@ def get(resource_group_name, service_name, api_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, api_id, custom_headers:nil) - get_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, custom_headers).value! end # @@ -193,22 +187,15 @@ def get_with_http_info(resource_group_name, service_name, api_id, custom_headers # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, api_id, custom_headers:nil) + def get_async(resource_group_name, service_name, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -269,8 +256,8 @@ def get_async(resource_group_name, service_name, api_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, api_id, parameters, if_match:nil, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match:if_match, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! nil end @@ -291,8 +278,8 @@ def create_or_update(resource_group_name, service_name, api_id, parameters, if_m # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match:nil, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match:if_match, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! end # @@ -312,29 +299,24 @@ def create_or_update_with_http_info(resource_group_name, service_name, api_id, p # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match:nil, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ApiContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -386,8 +368,8 @@ def create_or_update_async(resource_group_name, service_name, api_id, parameters # will be added to the HTTP request. # # - def update(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! nil end @@ -407,8 +389,8 @@ def update(resource_group_name, service_name, api_id, parameters, if_match, cust # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! end # @@ -427,16 +409,10 @@ def update_with_http_info(resource_group_name, service_name, api_id, parameters, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -444,13 +420,14 @@ def update_async(resource_group_name, service_name, api_id, parameters, if_match request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::PatchParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -501,8 +478,8 @@ def update_async(resource_group_name, service_name, api_id, parameters, if_match # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, api_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, if_match, custom_headers).value! nil end @@ -521,8 +498,8 @@ def delete(resource_group_name, service_name, api_id, if_match, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, api_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, if_match, custom_headers).value! end # @@ -540,23 +517,16 @@ def delete_with_http_info(resource_group_name, service_name, api_id, if_match, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, api_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -604,8 +574,8 @@ def delete_async(resource_group_name, service_name, api_id, if_match, custom_hea # # @return [ApiExportResult] operation results. # - def export(resource_group_name, service_name, api_id, custom_headers:nil) - response = export_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def export(resource_group_name, service_name, api_id, custom_headers = nil) + response = export_async(resource_group_name, service_name, api_id, custom_headers).value! response.body unless response.nil? end @@ -621,8 +591,8 @@ def export(resource_group_name, service_name, api_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def export_with_http_info(resource_group_name, service_name, api_id, custom_headers:nil) - export_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def export_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + export_async(resource_group_name, service_name, api_id, custom_headers).value! end # @@ -637,22 +607,15 @@ def export_with_http_info(resource_group_name, service_name, api_id, custom_head # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def export_async(resource_group_name, service_name, api_id, custom_headers:nil) + def export_async(resource_group_name, service_name, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -707,8 +670,8 @@ def export_async(resource_group_name, service_name, api_id, custom_headers:nil) # # @return [ApiCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -722,8 +685,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -736,12 +699,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -805,12 +767,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # # @return [ApiCollection] which provide lazy access to pages of the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/authorization_servers.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/authorization_servers.rb index 12d861ac01..46accc1d50 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/authorization_servers.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/authorization_servers.rb @@ -41,8 +41,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -66,8 +66,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -90,20 +90,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -159,8 +153,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [OAuth2AuthorizationServerContract] operation results. # - def get(resource_group_name, service_name, authsid, custom_headers:nil) - response = get_async(resource_group_name, service_name, authsid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, authsid, custom_headers = nil) + response = get_async(resource_group_name, service_name, authsid, custom_headers).value! response.body unless response.nil? end @@ -175,8 +169,8 @@ def get(resource_group_name, service_name, authsid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, authsid, custom_headers:nil) - get_async(resource_group_name, service_name, authsid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, authsid, custom_headers = nil) + get_async(resource_group_name, service_name, authsid, custom_headers).value! end # @@ -190,21 +184,15 @@ def get_with_http_info(resource_group_name, service_name, authsid, custom_header # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, authsid, custom_headers:nil) + def get_async(resource_group_name, service_name, authsid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'authsid is nil' if authsid.nil? - fail ArgumentError, "'authsid' should satisfy the constraint - 'MaxLength': '256'" if !authsid.nil? && authsid.length > 256 - fail ArgumentError, "'authsid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !authsid.nil? && authsid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -261,8 +249,8 @@ def get_async(resource_group_name, service_name, authsid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, authsid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, authsid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers).value! nil end @@ -279,8 +267,8 @@ def create_or_update(resource_group_name, service_name, authsid, parameters, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, authsid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, authsid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers).value! end # @@ -296,27 +284,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, authsid, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'authsid is nil' if authsid.nil? - fail ArgumentError, "'authsid' should satisfy the constraint - 'MaxLength': '256'" if !authsid.nil? && authsid.length > 256 - fail ArgumentError, "'authsid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !authsid.nil? && authsid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::OAuth2AuthorizationServerContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -368,8 +352,8 @@ def create_or_update_async(resource_group_name, service_name, authsid, parameter # will be added to the HTTP request. # # - def update(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers).value! nil end @@ -389,8 +373,8 @@ def update(resource_group_name, service_name, authsid, parameters, if_match, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers).value! end # @@ -409,12 +393,9 @@ def update_with_http_info(resource_group_name, service_name, authsid, parameters # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'authsid is nil' if authsid.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? @@ -423,13 +404,14 @@ def update_async(resource_group_name, service_name, authsid, parameters, if_matc request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::OAuth2AuthorizationServerUpdateContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -479,8 +461,8 @@ def update_async(resource_group_name, service_name, authsid, parameters, if_matc # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, authsid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, authsid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, authsid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, authsid, if_match, custom_headers).value! nil end @@ -498,8 +480,8 @@ def delete(resource_group_name, service_name, authsid, if_match, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, authsid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, authsid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, authsid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, authsid, if_match, custom_headers).value! end # @@ -516,12 +498,9 @@ def delete_with_http_info(resource_group_name, service_name, authsid, if_match, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, authsid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, authsid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'authsid is nil' if authsid.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -529,7 +508,6 @@ def delete_async(resource_group_name, service_name, authsid, if_match, custom_he request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -576,8 +554,8 @@ def delete_async(resource_group_name, service_name, authsid, if_match, custom_he # # @return [AuthorizationServerCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -592,8 +570,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -607,12 +585,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -677,12 +654,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [AuthorizationServerCollection] which provide lazy access to pages of # the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/backends.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/backends.rb index 90b9a7de3e..885f2fc8dd 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/backends.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/backends.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -87,20 +87,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -157,8 +151,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [BackendResponse] operation results. # - def get(resource_group_name, service_name, backendid, custom_headers:nil) - response = get_async(resource_group_name, service_name, backendid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, backendid, custom_headers = nil) + response = get_async(resource_group_name, service_name, backendid, custom_headers).value! response.body unless response.nil? end @@ -174,8 +168,8 @@ def get(resource_group_name, service_name, backendid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, backendid, custom_headers:nil) - get_async(resource_group_name, service_name, backendid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, backendid, custom_headers = nil) + get_async(resource_group_name, service_name, backendid, custom_headers).value! end # @@ -190,22 +184,15 @@ def get_with_http_info(resource_group_name, service_name, backendid, custom_head # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, backendid, custom_headers:nil) + def get_async(resource_group_name, service_name, backendid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'backendid is nil' if backendid.nil? - fail ArgumentError, "'backendid' should satisfy the constraint - 'MaxLength': '255'" if !backendid.nil? && backendid.length > 255 - fail ArgumentError, "'backendid' should satisfy the constraint - 'MinLength': '1'" if !backendid.nil? && backendid.length < 1 - fail ArgumentError, "'backendid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !backendid.nil? && backendid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -262,8 +249,8 @@ def get_async(resource_group_name, service_name, backendid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, backendid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, backendid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers).value! nil end @@ -280,8 +267,8 @@ def create_or_update(resource_group_name, service_name, backendid, parameters, c # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, backendid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, backendid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers).value! end # @@ -297,28 +284,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, backendid # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'backendid is nil' if backendid.nil? - fail ArgumentError, "'backendid' should satisfy the constraint - 'MaxLength': '255'" if !backendid.nil? && backendid.length > 255 - fail ArgumentError, "'backendid' should satisfy the constraint - 'MinLength': '1'" if !backendid.nil? && backendid.length < 1 - fail ArgumentError, "'backendid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !backendid.nil? && backendid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::BackendContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -370,8 +352,8 @@ def create_or_update_async(resource_group_name, service_name, backendid, paramet # will be added to the HTTP request. # # - def update(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers).value! nil end @@ -391,8 +373,8 @@ def update(resource_group_name, service_name, backendid, parameters, if_match, c # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers).value! end # @@ -411,16 +393,10 @@ def update_with_http_info(resource_group_name, service_name, backendid, paramete # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'backendid is nil' if backendid.nil? - fail ArgumentError, "'backendid' should satisfy the constraint - 'MaxLength': '255'" if !backendid.nil? && backendid.length > 255 - fail ArgumentError, "'backendid' should satisfy the constraint - 'MinLength': '1'" if !backendid.nil? && backendid.length < 1 - fail ArgumentError, "'backendid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !backendid.nil? && backendid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -428,13 +404,14 @@ def update_async(resource_group_name, service_name, backendid, parameters, if_ma request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::BackendUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -485,8 +462,8 @@ def update_async(resource_group_name, service_name, backendid, parameters, if_ma # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, backendid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, backendid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, backendid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, backendid, if_match, custom_headers).value! nil end @@ -505,8 +482,8 @@ def delete(resource_group_name, service_name, backendid, if_match, custom_header # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, backendid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, backendid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, backendid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, backendid, if_match, custom_headers).value! end # @@ -524,23 +501,16 @@ def delete_with_http_info(resource_group_name, service_name, backendid, if_match # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, backendid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, backendid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'backendid is nil' if backendid.nil? - fail ArgumentError, "'backendid' should satisfy the constraint - 'MaxLength': '255'" if !backendid.nil? && backendid.length > 255 - fail ArgumentError, "'backendid' should satisfy the constraint - 'MinLength': '1'" if !backendid.nil? && backendid.length < 1 - fail ArgumentError, "'backendid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !backendid.nil? && backendid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -586,8 +556,8 @@ def delete_async(resource_group_name, service_name, backendid, if_match, custom_ # # @return [BackendCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -601,8 +571,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -615,12 +585,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -684,12 +653,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [BackendCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/certificates.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/certificates.rb index 96855a8861..7204c721a6 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/certificates.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/certificates.rb @@ -44,8 +44,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -72,8 +72,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -99,20 +99,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -168,8 +162,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [CertificateContract] operation results. # - def get(resource_group_name, service_name, certificate_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, certificate_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, certificate_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, certificate_id, custom_headers).value! response.body unless response.nil? end @@ -184,8 +178,8 @@ def get(resource_group_name, service_name, certificate_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, certificate_id, custom_headers:nil) - get_async(resource_group_name, service_name, certificate_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, certificate_id, custom_headers = nil) + get_async(resource_group_name, service_name, certificate_id, custom_headers).value! end # @@ -199,19 +193,15 @@ def get_with_http_info(resource_group_name, service_name, certificate_id, custom # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, certificate_id, custom_headers:nil) + def get_async(resource_group_name, service_name, certificate_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -272,8 +262,8 @@ def get_async(resource_group_name, service_name, certificate_id, custom_headers: # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, certificate_id, parameters, if_match:nil, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match:if_match, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match, custom_headers).value! nil end @@ -294,8 +284,8 @@ def create_or_update(resource_group_name, service_name, certificate_id, paramete # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, certificate_id, parameters, if_match:nil, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match:if_match, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match, custom_headers).value! end # @@ -315,29 +305,24 @@ def create_or_update_with_http_info(resource_group_name, service_name, certifica # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match:nil, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'MaxLength': '256'" if !certificate_id.nil? && certificate_id.length > 256 - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'MinLength': '1'" if !certificate_id.nil? && certificate_id.length < 1 - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !certificate_id.nil? && certificate_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::CertificateCreateOrUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -387,8 +372,8 @@ def create_or_update_async(resource_group_name, service_name, certificate_id, pa # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, certificate_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers).value! nil end @@ -406,8 +391,8 @@ def delete(resource_group_name, service_name, certificate_id, if_match, custom_h # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, certificate_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers).value! end # @@ -424,12 +409,9 @@ def delete_with_http_info(resource_group_name, service_name, certificate_id, if_ # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -437,7 +419,6 @@ def delete_async(resource_group_name, service_name, certificate_id, if_match, cu request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -483,8 +464,8 @@ def delete_async(resource_group_name, service_name, certificate_id, if_match, cu # # @return [CertificateCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -498,8 +479,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -512,12 +493,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -585,12 +565,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [CertificateCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/group_users.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/group_users.rb index 13f6ff825e..554ab2b332 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/group_users.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/group_users.rb @@ -52,8 +52,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_group(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_group_as_lazy(resource_group_name, service_name, group_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_group(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_group_as_lazy(resource_group_name, service_name, group_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -88,8 +88,8 @@ def list_by_group(resource_group_name, service_name, group_id, filter:nil, top:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_group_with_http_info(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_group_async(resource_group_name, service_name, group_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_group_with_http_info(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_group_async(resource_group_name, service_name, group_id, filter, top, skip, custom_headers).value! end # @@ -123,24 +123,15 @@ def list_by_group_with_http_info(resource_group_name, service_name, group_id, fi # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_group_async(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_group_async(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -199,8 +190,8 @@ def list_by_group_async(resource_group_name, service_name, group_id, filter:nil, # # @return [ErrorBodyContract] operation results. # - def add(resource_group_name, service_name, group_id, uid, custom_headers:nil) - response = add_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value! + def add(resource_group_name, service_name, group_id, uid, custom_headers = nil) + response = add_async(resource_group_name, service_name, group_id, uid, custom_headers).value! response.body unless response.nil? end @@ -218,8 +209,8 @@ def add(resource_group_name, service_name, group_id, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def add_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers:nil) - add_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value! + def add_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers = nil) + add_async(resource_group_name, service_name, group_id, uid, custom_headers).value! end # @@ -236,26 +227,16 @@ def add_with_http_info(resource_group_name, service_name, group_id, uid, custom_ # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def add_async(resource_group_name, service_name, group_id, uid, custom_headers:nil) + def add_async(resource_group_name, service_name, group_id, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -314,8 +295,8 @@ def add_async(resource_group_name, service_name, group_id, uid, custom_headers:n # # @return [ErrorBodyContract] operation results. # - def remove(resource_group_name, service_name, group_id, uid, custom_headers:nil) - response = remove_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value! + def remove(resource_group_name, service_name, group_id, uid, custom_headers = nil) + response = remove_async(resource_group_name, service_name, group_id, uid, custom_headers).value! response.body unless response.nil? end @@ -333,8 +314,8 @@ def remove(resource_group_name, service_name, group_id, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def remove_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers:nil) - remove_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value! + def remove_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers = nil) + remove_async(resource_group_name, service_name, group_id, uid, custom_headers).value! end # @@ -351,26 +332,16 @@ def remove_with_http_info(resource_group_name, service_name, group_id, uid, cust # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def remove_async(resource_group_name, service_name, group_id, uid, custom_headers:nil) + def remove_async(resource_group_name, service_name, group_id, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -425,8 +396,8 @@ def remove_async(resource_group_name, service_name, group_id, uid, custom_header # # @return [UserCollection] operation results. # - def list_by_group_next(next_page_link, custom_headers:nil) - response = list_by_group_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_group_next(next_page_link, custom_headers = nil) + response = list_by_group_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -440,8 +411,8 @@ def list_by_group_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_group_next_with_http_info(next_page_link, custom_headers:nil) - list_by_group_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_group_next_with_http_info(next_page_link, custom_headers = nil) + list_by_group_next_async(next_page_link, custom_headers).value! end # @@ -454,12 +425,11 @@ def list_by_group_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_group_next_async(next_page_link, custom_headers:nil) + def list_by_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 @@ -534,12 +504,12 @@ def list_by_group_next_async(next_page_link, custom_headers:nil) # # @return [UserCollection] which provide lazy access to pages of the response. # - def list_by_group_as_lazy(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_group_async(resource_group_name, service_name, group_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_group_as_lazy(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_group_async(resource_group_name, service_name, group_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_group_next_async(next_page_link, custom_headers:custom_headers) + list_by_group_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/groups.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/groups.rb index 765650c69c..2f7a930fed 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/groups.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/groups.rb @@ -44,8 +44,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -72,8 +72,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -99,20 +99,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -169,8 +163,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [GroupContract] operation results. # - def get(resource_group_name, service_name, group_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, group_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, group_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, group_id, custom_headers).value! response.body unless response.nil? end @@ -186,8 +180,8 @@ def get(resource_group_name, service_name, group_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, group_id, custom_headers:nil) - get_async(resource_group_name, service_name, group_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, group_id, custom_headers = nil) + get_async(resource_group_name, service_name, group_id, custom_headers).value! end # @@ -202,22 +196,15 @@ def get_with_http_info(resource_group_name, service_name, group_id, custom_heade # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, group_id, custom_headers:nil) + def get_async(resource_group_name, service_name, group_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -274,8 +261,8 @@ def get_async(resource_group_name, service_name, group_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, group_id, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, group_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers).value! nil end @@ -292,8 +279,8 @@ def create_or_update(resource_group_name, service_name, group_id, parameters, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, group_id, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, group_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers).value! end # @@ -309,28 +296,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, group_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::GroupCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -383,8 +365,8 @@ def create_or_update_async(resource_group_name, service_name, group_id, paramete # # @return [ErrorBodyContract] operation results. # - def update(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers).value! response.body unless response.nil? end @@ -404,8 +386,8 @@ def update(resource_group_name, service_name, group_id, parameters, if_match, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers).value! end # @@ -424,16 +406,10 @@ def update_with_http_info(resource_group_name, service_name, group_id, parameter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -441,13 +417,14 @@ def update_async(resource_group_name, service_name, group_id, parameters, if_mat request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::GroupUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -509,8 +486,8 @@ def update_async(resource_group_name, service_name, group_id, parameters, if_mat # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, group_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, group_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, group_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, group_id, if_match, custom_headers).value! response.body unless response.nil? end @@ -529,8 +506,8 @@ def delete(resource_group_name, service_name, group_id, if_match, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, group_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, group_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, group_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, group_id, if_match, custom_headers).value! end # @@ -548,23 +525,16 @@ def delete_with_http_info(resource_group_name, service_name, group_id, if_match, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, group_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, group_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -620,8 +590,8 @@ def delete_async(resource_group_name, service_name, group_id, if_match, custom_h # # @return [GroupCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -635,8 +605,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -649,12 +619,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -721,12 +690,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # # @return [GroupCollection] which provide lazy access to pages of the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/identity_providers.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/identity_providers.rb index b31cee8816..d9061cf76d 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/identity_providers.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/identity_providers.rb @@ -32,8 +32,8 @@ def initialize(client) # # @return [IdentityProviderList] operation results. # - def list_by_service(resource_group_name, service_name, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def list_by_service(resource_group_name, service_name, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -48,8 +48,8 @@ def list_by_service(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, custom_headers).value! end # @@ -63,18 +63,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, custom_hea # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, custom_headers:nil) + def list_by_service_async(resource_group_name, service_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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[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 @@ -133,8 +129,8 @@ def list_by_service_async(resource_group_name, service_name, custom_headers:nil) # # @return [IdentityProviderContract] operation results. # - def get(resource_group_name, service_name, identity_provider_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, identity_provider_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, identity_provider_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, identity_provider_name, custom_headers).value! response.body unless response.nil? end @@ -152,8 +148,8 @@ def get(resource_group_name, service_name, identity_provider_name, custom_header # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, identity_provider_name, custom_headers:nil) - get_async(resource_group_name, service_name, identity_provider_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, identity_provider_name, custom_headers = nil) + get_async(resource_group_name, service_name, identity_provider_name, custom_headers).value! end # @@ -170,19 +166,15 @@ def get_with_http_info(resource_group_name, service_name, identity_provider_name # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, identity_provider_name, custom_headers:nil) + def get_async(resource_group_name, service_name, identity_provider_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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'identity_provider_name is nil' if identity_provider_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 @@ -240,8 +232,8 @@ def get_async(resource_group_name, service_name, identity_provider_name, custom_ # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, identity_provider_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers).value! nil end @@ -259,8 +251,8 @@ def create_or_update(resource_group_name, service_name, identity_provider_name, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers).value! end # @@ -277,12 +269,9 @@ def create_or_update_with_http_info(resource_group_name, service_name, identity_ # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -290,12 +279,13 @@ def create_or_update_async(resource_group_name, service_name, identity_provider_ 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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::IdentityProviderContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -348,8 +338,8 @@ def create_or_update_async(resource_group_name, service_name, identity_provider_ # will be added to the HTTP request. # # - def update(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers).value! nil end @@ -370,8 +360,8 @@ def update(resource_group_name, service_name, identity_provider_name, parameters # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers).value! end # @@ -391,12 +381,9 @@ def update_with_http_info(resource_group_name, service_name, identity_provider_n # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? @@ -405,13 +392,14 @@ def update_async(resource_group_name, service_name, identity_provider_name, para request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::IdentityProviderUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -463,8 +451,8 @@ def update_async(resource_group_name, service_name, identity_provider_name, para # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers).value! nil end @@ -484,8 +472,8 @@ def delete(resource_group_name, service_name, identity_provider_name, if_match, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers).value! end # @@ -504,12 +492,9 @@ def delete_with_http_info(resource_group_name, service_name, identity_provider_n # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -517,7 +502,6 @@ def delete_async(resource_group_name, service_name, identity_provider_name, if_m request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/loggers.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/loggers.rb index 69ccd9a0e5..8293ed7eee 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/loggers.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/loggers.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -87,20 +87,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -156,8 +150,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [LoggerResponse] operation results. # - def get(resource_group_name, service_name, loggerid, custom_headers:nil) - response = get_async(resource_group_name, service_name, loggerid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, loggerid, custom_headers = nil) + response = get_async(resource_group_name, service_name, loggerid, custom_headers).value! response.body unless response.nil? end @@ -172,8 +166,8 @@ def get(resource_group_name, service_name, loggerid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, loggerid, custom_headers:nil) - get_async(resource_group_name, service_name, loggerid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, loggerid, custom_headers = nil) + get_async(resource_group_name, service_name, loggerid, custom_headers).value! end # @@ -187,19 +181,15 @@ def get_with_http_info(resource_group_name, service_name, loggerid, custom_heade # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, loggerid, custom_headers:nil) + def get_async(resource_group_name, service_name, loggerid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'loggerid is nil' if loggerid.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -255,8 +245,8 @@ def get_async(resource_group_name, service_name, loggerid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, loggerid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, loggerid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers).value! nil end @@ -272,8 +262,8 @@ def create_or_update(resource_group_name, service_name, loggerid, parameters, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, loggerid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, loggerid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers).value! end # @@ -288,27 +278,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, loggerid, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'loggerid is nil' if loggerid.nil? - fail ArgumentError, "'loggerid' should satisfy the constraint - 'MaxLength': '256'" if !loggerid.nil? && loggerid.length > 256 - fail ArgumentError, "'loggerid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !loggerid.nil? && loggerid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::LoggerCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -359,8 +345,8 @@ def create_or_update_async(resource_group_name, service_name, loggerid, paramete # will be added to the HTTP request. # # - def update(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers).value! nil end @@ -379,8 +365,8 @@ def update(resource_group_name, service_name, loggerid, parameters, if_match, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers).value! end # @@ -398,12 +384,9 @@ def update_with_http_info(resource_group_name, service_name, loggerid, parameter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'loggerid is nil' if loggerid.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? @@ -412,13 +395,14 @@ def update_async(resource_group_name, service_name, loggerid, parameters, if_mat request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::LoggerUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -468,8 +452,8 @@ def update_async(resource_group_name, service_name, loggerid, parameters, if_mat # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, loggerid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers).value! nil end @@ -487,8 +471,8 @@ def delete(resource_group_name, service_name, loggerid, if_match, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, loggerid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers).value! end # @@ -505,12 +489,9 @@ def delete_with_http_info(resource_group_name, service_name, loggerid, if_match, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'loggerid is nil' if loggerid.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -518,7 +499,6 @@ def delete_async(resource_group_name, service_name, loggerid, if_match, custom_h request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -564,8 +544,8 @@ def delete_async(resource_group_name, service_name, loggerid, if_match, custom_h # # @return [LoggerCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -579,8 +559,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -593,12 +573,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -662,12 +641,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [LoggerCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/access_information_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/access_information_contract.rb index 01865ce083..a0997e121f 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/access_information_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/access_information_contract.rb @@ -32,7 +32,6 @@ class AccessInformationContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AccessInformationContract', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'AccessInformationContract', model_properties: { id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { @@ -48,7 +46,6 @@ def self.mapper() } }, primary_key: { - client_side_validation: true, required: false, serialized_name: 'primaryKey', type: { @@ -56,7 +53,6 @@ def self.mapper() } }, secondary_key: { - client_side_validation: true, required: false, serialized_name: 'secondaryKey', type: { @@ -64,7 +60,6 @@ def self.mapper() } }, enabled: { - client_side_validation: true, required: false, serialized_name: 'enabled', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb index fd0538d57c..e408e6cc2b 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb @@ -24,7 +24,6 @@ class AccessInformationUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AccessInformationUpdateParameters', type: { @@ -32,7 +31,6 @@ def self.mapper() class_name: 'AccessInformationUpdateParameters', model_properties: { enabled: { - client_side_validation: true, required: true, serialized_name: 'enabled', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/additional_region.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/additional_region.rb index d3be14026b..6e4e200be0 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/additional_region.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/additional_region.rb @@ -41,7 +41,6 @@ class AdditionalRegion # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AdditionalRegion', type: { @@ -49,7 +48,6 @@ def self.mapper() class_name: 'AdditionalRegion', model_properties: { location: { - client_side_validation: true, required: true, serialized_name: 'location', type: { @@ -57,7 +55,6 @@ def self.mapper() } }, sku_type: { - client_side_validation: true, required: true, serialized_name: 'skuType', type: { @@ -66,7 +63,6 @@ def self.mapper() } }, sku_unit_count: { - client_side_validation: true, required: false, serialized_name: 'skuUnitCount', default_value: 1, @@ -78,14 +74,12 @@ def self.mapper() } }, static_ips: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'staticIPs', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -95,7 +89,6 @@ def self.mapper() } }, vpnconfiguration: { - client_side_validation: true, required: false, serialized_name: 'vpnconfiguration', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_collection.rb index 85af9fe7c5..c157650d56 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'ApiCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ApiContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_contract.rb index fd9ea5b632..4f62d0ff51 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_contract.rb @@ -55,7 +55,6 @@ class ApiContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiContract', type: { @@ -63,7 +62,6 @@ def self.mapper() class_name: 'ApiContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -72,7 +70,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -84,7 +81,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -92,7 +88,6 @@ def self.mapper() } }, service_url: { - client_side_validation: true, required: true, serialized_name: 'serviceUrl', constraints: { @@ -104,7 +99,6 @@ def self.mapper() } }, path: { - client_side_validation: true, required: true, serialized_name: 'path', constraints: { @@ -116,13 +110,11 @@ def self.mapper() } }, protocols: { - client_side_validation: true, required: true, serialized_name: 'protocols', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ApiProtocolContractElementType', type: { @@ -133,7 +125,6 @@ def self.mapper() } }, authentication_settings: { - client_side_validation: true, required: false, serialized_name: 'authenticationSettings', type: { @@ -142,7 +133,6 @@ def self.mapper() } }, subscription_key_parameter_names: { - client_side_validation: true, required: false, serialized_name: 'subscriptionKeyParameterNames', type: { @@ -151,7 +141,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_export_result.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_export_result.rb index ad20ac1eb9..e29796e427 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_export_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_export_result.rb @@ -29,7 +29,6 @@ class ApiExportResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiExportResult', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'ApiExportResult', model_properties: { content: { - client_side_validation: true, required: false, serialized_name: 'content', type: { @@ -45,7 +43,6 @@ def self.mapper() } }, status_code: { - client_side_validation: true, required: false, serialized_name: 'statusCode', type: { @@ -54,7 +51,6 @@ def self.mapper() } }, request_id: { - client_side_validation: true, required: false, serialized_name: 'requestId', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb index c47133c1cd..abe01284e0 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb @@ -36,7 +36,6 @@ class ApiManagementServiceBackupRestoreParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceBackupRestoreParameters', type: { @@ -44,7 +43,6 @@ def self.mapper() class_name: 'ApiManagementServiceBackupRestoreParameters', model_properties: { storage_account: { - client_side_validation: true, required: true, serialized_name: 'storageAccount', type: { @@ -52,7 +50,6 @@ def self.mapper() } }, access_key: { - client_side_validation: true, required: true, serialized_name: 'accessKey', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, container_name: { - client_side_validation: true, required: true, serialized_name: 'containerName', type: { @@ -68,7 +64,6 @@ def self.mapper() } }, backup_name: { - client_side_validation: true, required: true, serialized_name: 'backupName', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_base_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_base_parameters.rb index 8f81204dbd..d32119577a 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_base_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_base_parameters.rb @@ -96,7 +96,6 @@ class ApiManagementServiceBaseParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceBaseParameters', type: { @@ -104,13 +103,11 @@ def self.mapper() class_name: 'ApiManagementServiceBaseParameters', model_properties: { tags: { - client_side_validation: true, required: false, serialized_name: 'tags', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -120,7 +117,6 @@ def self.mapper() } }, publisher_email: { - client_side_validation: true, required: true, serialized_name: 'properties.publisherEmail', constraints: { @@ -131,7 +127,6 @@ def self.mapper() } }, publisher_name: { - client_side_validation: true, required: true, serialized_name: 'properties.publisherName', type: { @@ -139,7 +134,6 @@ def self.mapper() } }, provisioning_state: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.provisioningState', @@ -148,7 +142,6 @@ def self.mapper() } }, target_provisioning_state: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.targetProvisioningState', @@ -157,7 +150,6 @@ def self.mapper() } }, created_at_utc: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.createdAtUtc', @@ -166,7 +158,6 @@ def self.mapper() } }, runtime_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.runtimeUrl', @@ -175,7 +166,6 @@ def self.mapper() } }, portal_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.portalUrl', @@ -184,7 +174,6 @@ def self.mapper() } }, management_api_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.managementApiUrl', @@ -193,7 +182,6 @@ def self.mapper() } }, scm_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.scmUrl', @@ -202,7 +190,6 @@ def self.mapper() } }, addresser_email: { - client_side_validation: true, required: false, serialized_name: 'properties.addresserEmail', type: { @@ -210,13 +197,11 @@ def self.mapper() } }, hostname_configurations: { - client_side_validation: true, required: false, serialized_name: 'properties.hostnameConfigurations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'HostnameConfigurationElementType', type: { @@ -227,14 +212,12 @@ def self.mapper() } }, static_ips: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.staticIPs', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -244,7 +227,6 @@ def self.mapper() } }, vpnconfiguration: { - client_side_validation: true, required: false, serialized_name: 'properties.vpnconfiguration', type: { @@ -253,13 +235,11 @@ def self.mapper() } }, additional_locations: { - client_side_validation: true, required: false, serialized_name: 'properties.additionalLocations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'AdditionalRegionElementType', type: { @@ -270,13 +250,11 @@ def self.mapper() } }, custom_properties: { - client_side_validation: true, required: false, serialized_name: 'properties.customProperties', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -286,7 +264,6 @@ def self.mapper() } }, vpn_type: { - client_side_validation: true, required: false, serialized_name: 'properties.vpnType', default_value: 'None', @@ -296,7 +273,6 @@ def self.mapper() } }, sku: { - client_side_validation: true, required: false, serialized_name: 'sku', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb index c661379346..3724b9f284 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb @@ -23,7 +23,6 @@ class ApiManagementServiceCheckNameAvailabilityParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceCheckNameAvailabilityParameters', type: { @@ -31,7 +30,6 @@ def self.mapper() class_name: 'ApiManagementServiceCheckNameAvailabilityParameters', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb index 5174c47d5e..62f72bfc36 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb @@ -22,7 +22,6 @@ class ApiManagementServiceGetSsoTokenResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceGetSsoTokenResult', type: { @@ -30,7 +29,6 @@ def self.mapper() class_name: 'ApiManagementServiceGetSsoTokenResult', model_properties: { redirect_uri: { - client_side_validation: true, required: false, serialized_name: 'redirect_uri', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb index 47122072c4..f55c0d100e 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb @@ -59,7 +59,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceListResult', type: { @@ -67,13 +66,11 @@ def self.mapper() class_name: 'ApiManagementServiceListResult', model_properties: { value: { - client_side_validation: true, required: true, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceResourceElementType', type: { @@ -84,7 +81,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_manage_deployments_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_manage_deployments_parameters.rb index 6d7a1c803c..8273be76d5 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_manage_deployments_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_manage_deployments_parameters.rb @@ -50,7 +50,6 @@ class ApiManagementServiceManageDeploymentsParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceManageDeploymentsParameters', type: { @@ -58,7 +57,6 @@ def self.mapper() class_name: 'ApiManagementServiceManageDeploymentsParameters', model_properties: { location: { - client_side_validation: true, required: true, serialized_name: 'location', type: { @@ -66,7 +64,6 @@ def self.mapper() } }, sku_type: { - client_side_validation: true, required: true, serialized_name: 'skuType', type: { @@ -75,7 +72,6 @@ def self.mapper() } }, sku_unit_count: { - client_side_validation: true, required: false, serialized_name: 'skuUnitCount', default_value: 1, @@ -84,13 +80,11 @@ def self.mapper() } }, additional_locations: { - client_side_validation: true, required: false, serialized_name: 'additionalLocations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'AdditionalRegionElementType', type: { @@ -101,7 +95,6 @@ def self.mapper() } }, vpn_configuration: { - client_side_validation: true, required: false, serialized_name: 'vpnConfiguration', type: { @@ -110,7 +103,6 @@ def self.mapper() } }, vpn_type: { - client_side_validation: true, required: false, serialized_name: 'vpnType', default_value: 'None', diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb index cde28d1b9b..2713d0cf89 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb @@ -38,7 +38,6 @@ class ApiManagementServiceNameAvailabilityResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceNameAvailabilityResult', type: { @@ -46,7 +45,6 @@ def self.mapper() class_name: 'ApiManagementServiceNameAvailabilityResult', model_properties: { name_available: { - client_side_validation: true, required: true, serialized_name: 'nameAvailable', type: { @@ -54,7 +52,6 @@ def self.mapper() } }, message: { - client_side_validation: true, required: false, serialized_name: 'message', type: { @@ -62,7 +59,6 @@ def self.mapper() } }, reason: { - client_side_validation: true, required: false, serialized_name: 'reason', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_resource.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_resource.rb index db0b1e351b..1c2b607d69 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_resource.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_resource.rb @@ -34,7 +34,6 @@ class ApiManagementServiceResource < ApiManagementServiceBaseParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceResource', type: { @@ -42,13 +41,11 @@ def self.mapper() class_name: 'ApiManagementServiceResource', model_properties: { tags: { - client_side_validation: true, required: false, serialized_name: 'tags', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -58,7 +55,6 @@ def self.mapper() } }, publisher_email: { - client_side_validation: true, required: true, serialized_name: 'properties.publisherEmail', constraints: { @@ -69,7 +65,6 @@ def self.mapper() } }, publisher_name: { - client_side_validation: true, required: true, serialized_name: 'properties.publisherName', type: { @@ -77,7 +72,6 @@ def self.mapper() } }, provisioning_state: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.provisioningState', @@ -86,7 +80,6 @@ def self.mapper() } }, target_provisioning_state: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.targetProvisioningState', @@ -95,7 +88,6 @@ def self.mapper() } }, created_at_utc: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.createdAtUtc', @@ -104,7 +96,6 @@ def self.mapper() } }, runtime_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.runtimeUrl', @@ -113,7 +104,6 @@ def self.mapper() } }, portal_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.portalUrl', @@ -122,7 +112,6 @@ def self.mapper() } }, management_api_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.managementApiUrl', @@ -131,7 +120,6 @@ def self.mapper() } }, scm_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.scmUrl', @@ -140,7 +128,6 @@ def self.mapper() } }, addresser_email: { - client_side_validation: true, required: false, serialized_name: 'properties.addresserEmail', type: { @@ -148,13 +135,11 @@ def self.mapper() } }, hostname_configurations: { - client_side_validation: true, required: false, serialized_name: 'properties.hostnameConfigurations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'HostnameConfigurationElementType', type: { @@ -165,14 +150,12 @@ def self.mapper() } }, static_ips: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.staticIPs', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -182,7 +165,6 @@ def self.mapper() } }, vpnconfiguration: { - client_side_validation: true, required: false, serialized_name: 'properties.vpnconfiguration', type: { @@ -191,13 +173,11 @@ def self.mapper() } }, additional_locations: { - client_side_validation: true, required: false, serialized_name: 'properties.additionalLocations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'AdditionalRegionElementType', type: { @@ -208,13 +188,11 @@ def self.mapper() } }, custom_properties: { - client_side_validation: true, required: false, serialized_name: 'properties.customProperties', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -224,7 +202,6 @@ def self.mapper() } }, vpn_type: { - client_side_validation: true, required: false, serialized_name: 'properties.vpnType', default_value: 'None', @@ -234,7 +211,6 @@ def self.mapper() } }, sku: { - client_side_validation: true, required: false, serialized_name: 'sku', type: { @@ -243,7 +219,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -252,7 +227,6 @@ def self.mapper() } }, location: { - client_side_validation: true, required: true, serialized_name: 'location', type: { @@ -260,7 +234,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'name', @@ -269,7 +242,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'type', @@ -278,7 +250,6 @@ def self.mapper() } }, etag: { - client_side_validation: true, required: false, serialized_name: 'etag', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb index 77efc5e217..ba870c8217 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb @@ -27,7 +27,6 @@ class ApiManagementServiceSkuProperties # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceSkuProperties', type: { @@ -35,7 +34,6 @@ def self.mapper() class_name: 'ApiManagementServiceSkuProperties', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { @@ -44,7 +42,6 @@ def self.mapper() } }, capacity: { - client_side_validation: true, required: false, serialized_name: 'capacity', default_value: 1, diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb index d03e318cf0..b26db3eb03 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb @@ -26,7 +26,6 @@ class ApiManagementServiceUpdateHostnameParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceUpdateHostnameParameters', type: { @@ -34,13 +33,11 @@ def self.mapper() class_name: 'ApiManagementServiceUpdateHostnameParameters', model_properties: { update: { - client_side_validation: true, required: false, serialized_name: 'update', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'HostnameConfigurationElementType', type: { @@ -51,13 +48,11 @@ def self.mapper() } }, delete: { - client_side_validation: true, required: false, serialized_name: 'delete', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'HostnameTypeElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb index 9f7e8a9849..1d8ea3c3fa 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb @@ -31,7 +31,6 @@ class ApiManagementServiceUploadCertificateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceUploadCertificateParameters', type: { @@ -39,7 +38,6 @@ def self.mapper() class_name: 'ApiManagementServiceUploadCertificateParameters', model_properties: { type: { - client_side_validation: true, required: true, serialized_name: 'type', type: { @@ -48,7 +46,6 @@ def self.mapper() } }, certificate: { - client_side_validation: true, required: true, serialized_name: 'certificate', type: { @@ -56,7 +53,6 @@ def self.mapper() } }, certificate_password: { - client_side_validation: true, required: true, serialized_name: 'certificate_password', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb index e335a87b96..1a90476b23 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb @@ -22,7 +22,6 @@ class AuthenticationSettingsContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AuthenticationSettingsContract', type: { @@ -30,7 +29,6 @@ def self.mapper() class_name: 'AuthenticationSettingsContract', model_properties: { o_auth2: { - client_side_validation: true, required: false, serialized_name: 'oAuth2', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/authorization_server_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/authorization_server_collection.rb index 44c73fbe33..26aebea8f8 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/authorization_server_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/authorization_server_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AuthorizationServerCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'AuthorizationServerCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'OAuth2AuthorizationServerContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_collection.rb index 8232573967..f8f24ae913 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'BackendCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'BackendResponseElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_contract.rb index 230710460d..8648e448bb 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_contract.rb @@ -29,7 +29,6 @@ class BackendContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendContract', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'BackendContract', model_properties: { host: { - client_side_validation: true, required: true, serialized_name: 'host', constraints: { @@ -49,7 +47,6 @@ def self.mapper() } }, skip_certificate_chain_validation: { - client_side_validation: true, required: false, serialized_name: 'skipCertificateChainValidation', default_value: false, diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_response.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_response.rb index 781d8f321e..864d43b9a3 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_response.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_response.rb @@ -27,7 +27,6 @@ class BackendResponse < BackendContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendResponse', type: { @@ -35,7 +34,6 @@ def self.mapper() class_name: 'BackendResponse', model_properties: { host: { - client_side_validation: true, required: true, serialized_name: 'host', constraints: { @@ -47,7 +45,6 @@ def self.mapper() } }, skip_certificate_chain_validation: { - client_side_validation: true, required: false, serialized_name: 'skipCertificateChainValidation', default_value: false, @@ -56,7 +53,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_update_parameters.rb index 474f6a1d83..6452fb4684 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/backend_update_parameters.rb @@ -29,7 +29,6 @@ class BackendUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendUpdateParameters', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'BackendUpdateParameters', model_properties: { host: { - client_side_validation: true, required: false, serialized_name: 'host', constraints: { @@ -49,7 +47,6 @@ def self.mapper() } }, skip_certificate_chain_validation: { - client_side_validation: true, required: false, serialized_name: 'skipCertificateChainValidation', default_value: false, diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_collection.rb index 925387aacb..48914d911e 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'CertificateCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'CertificateCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'CertificateContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_contract.rb index 83b25bfb4e..06d269c46d 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_contract.rb @@ -35,7 +35,6 @@ class CertificateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'CertificateContract', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'CertificateContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -52,7 +50,6 @@ def self.mapper() } }, subject: { - client_side_validation: true, required: true, serialized_name: 'subject', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, thumbprint: { - client_side_validation: true, required: true, serialized_name: 'thumbprint', type: { @@ -68,7 +64,6 @@ def self.mapper() } }, expiration_date: { - client_side_validation: true, required: true, serialized_name: 'expirationDate', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb index 79884e476b..1e6a8333aa 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb @@ -26,7 +26,6 @@ class CertificateCreateOrUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'CertificateCreateOrUpdateParameters', type: { @@ -34,7 +33,6 @@ def self.mapper() class_name: 'CertificateCreateOrUpdateParameters', model_properties: { data: { - client_side_validation: true, required: true, serialized_name: 'data', type: { @@ -42,7 +40,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: true, serialized_name: 'password', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_information.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_information.rb index 21b3b23616..0505df8ffc 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_information.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/certificate_information.rb @@ -30,7 +30,6 @@ class CertificateInformation # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'CertificateInformation', type: { @@ -38,7 +37,6 @@ def self.mapper() class_name: 'CertificateInformation', model_properties: { expiry: { - client_side_validation: true, required: true, serialized_name: 'expiry', type: { @@ -46,7 +44,6 @@ def self.mapper() } }, thumbprint: { - client_side_validation: true, required: true, serialized_name: 'thumbprint', type: { @@ -54,7 +51,6 @@ def self.mapper() } }, subject: { - client_side_validation: true, required: true, serialized_name: 'subject', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb index c37a0c737a..a796841430 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb @@ -27,7 +27,6 @@ class DeployConfigurationParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'DeployConfigurationParameters', type: { @@ -35,7 +34,6 @@ def self.mapper() class_name: 'DeployConfigurationParameters', model_properties: { branch: { - client_side_validation: true, required: true, serialized_name: 'branch', type: { @@ -43,7 +41,6 @@ def self.mapper() } }, force: { - client_side_validation: true, required: false, serialized_name: 'force', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_body_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_body_contract.rb index eb03f336e1..cf18dc05b3 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_body_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_body_contract.rb @@ -30,7 +30,6 @@ class ErrorBodyContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ErrorBodyContract', type: { @@ -38,7 +37,6 @@ def self.mapper() class_name: 'ErrorBodyContract', model_properties: { code: { - client_side_validation: true, required: false, serialized_name: 'code', type: { @@ -46,7 +44,6 @@ def self.mapper() } }, message: { - client_side_validation: true, required: false, serialized_name: 'message', type: { @@ -54,13 +51,11 @@ def self.mapper() } }, details: { - client_side_validation: true, required: false, serialized_name: 'details', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ErrorFieldContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_field_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_field_contract.rb index 017e901eee..8ab1d4bd35 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_field_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_field_contract.rb @@ -28,7 +28,6 @@ class ErrorFieldContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ErrorFieldContract', type: { @@ -36,7 +35,6 @@ def self.mapper() class_name: 'ErrorFieldContract', model_properties: { code: { - client_side_validation: true, required: false, serialized_name: 'code', type: { @@ -44,7 +42,6 @@ def self.mapper() } }, message: { - client_side_validation: true, required: false, serialized_name: 'message', type: { @@ -52,7 +49,6 @@ def self.mapper() } }, target: { - client_side_validation: true, required: false, serialized_name: 'target', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_response.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_response.rb index 77fc8dcf4f..ce1d4b4128 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_response.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/error_response.rb @@ -25,7 +25,6 @@ class ErrorResponse # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ErrorResponse', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'ErrorResponse', model_properties: { code: { - client_side_validation: true, required: false, serialized_name: 'code', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, message: { - client_side_validation: true, required: false, serialized_name: 'message', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb index c53fab093e..aaaacdfb27 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb @@ -22,7 +22,6 @@ class GenerateSsoUrlResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GenerateSsoUrlResult', type: { @@ -30,7 +29,6 @@ def self.mapper() class_name: 'GenerateSsoUrlResult', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_collection.rb index 36ba787671..6cbe3dae13 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GroupCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'GroupCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'GroupContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_contract.rb index b5b451db97..d710ce72f8 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_contract.rb @@ -43,7 +43,6 @@ class GroupContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GroupContract', type: { @@ -51,7 +50,6 @@ def self.mapper() class_name: 'GroupContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -60,7 +58,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -72,7 +69,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -83,7 +79,6 @@ def self.mapper() } }, built_in: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'builtIn', @@ -92,7 +87,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'type', @@ -102,7 +96,6 @@ def self.mapper() } }, external_id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'externalId', diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_create_parameters.rb index a0cbbfbefa..2ae8ea97bd 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_create_parameters.rb @@ -32,7 +32,6 @@ class GroupCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GroupCreateParameters', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'GroupCreateParameters', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -52,7 +50,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { @@ -69,7 +65,6 @@ def self.mapper() } }, external_id: { - client_side_validation: true, required: false, serialized_name: 'externalId', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_update_parameters.rb index 94152c5565..4847958256 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/group_update_parameters.rb @@ -32,7 +32,6 @@ class GroupUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GroupUpdateParameters', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'GroupUpdateParameters', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -52,7 +50,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { @@ -69,7 +65,6 @@ def self.mapper() } }, external_id: { - client_side_validation: true, required: false, serialized_name: 'externalId', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/hostname_configuration.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/hostname_configuration.rb index 371bee480a..ab90521e62 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/hostname_configuration.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/hostname_configuration.rb @@ -29,7 +29,6 @@ class HostnameConfiguration # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'HostnameConfiguration', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'HostnameConfiguration', model_properties: { type: { - client_side_validation: true, required: true, serialized_name: 'type', type: { @@ -46,7 +44,6 @@ def self.mapper() } }, hostname: { - client_side_validation: true, required: true, serialized_name: 'hostname', type: { @@ -54,7 +51,6 @@ def self.mapper() } }, certificate: { - client_side_validation: true, required: true, serialized_name: 'certificate', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_contract.rb index 269574ba37..e1678e2d4e 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_contract.rb @@ -41,7 +41,6 @@ class IdentityProviderContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'IdentityProviderContract', type: { @@ -49,7 +48,6 @@ def self.mapper() class_name: 'IdentityProviderContract', model_properties: { client_id: { - client_side_validation: true, required: true, serialized_name: 'clientId', constraints: { @@ -60,7 +58,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: true, serialized_name: 'clientSecret', constraints: { @@ -71,7 +68,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { @@ -79,7 +75,6 @@ def self.mapper() } }, allowed_tenants: { - client_side_validation: true, required: false, serialized_name: 'allowedTenants', constraints: { @@ -88,7 +83,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_list.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_list.rb index 01dc3b28cb..e7c876e148 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_list.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_list.rb @@ -23,7 +23,6 @@ class IdentityProviderList # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'IdentityProviderList', type: { @@ -31,13 +30,11 @@ def self.mapper() class_name: 'IdentityProviderList', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'IdentityProviderContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb index 5d9bff0d63..27cf77db6c 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb @@ -34,7 +34,6 @@ class IdentityProviderUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'IdentityProviderUpdateParameters', type: { @@ -42,7 +41,6 @@ def self.mapper() class_name: 'IdentityProviderUpdateParameters', model_properties: { client_id: { - client_side_validation: true, required: false, serialized_name: 'clientId', constraints: { @@ -53,7 +51,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', constraints: { @@ -64,7 +61,6 @@ def self.mapper() } }, allowed_tenants: { - client_side_validation: true, required: false, serialized_name: 'allowedTenants', constraints: { @@ -73,7 +69,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_collection.rb index f1152b94a7..264a830fad 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'LoggerCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'LoggerCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'LoggerResponseElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_create_parameters.rb index 217692c102..4100de518f 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_create_parameters.rb @@ -33,7 +33,6 @@ class LoggerCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'LoggerCreateParameters', type: { @@ -41,7 +40,6 @@ def self.mapper() class_name: 'LoggerCreateParameters', model_properties: { type: { - client_side_validation: true, required: true, is_constant: true, serialized_name: 'type', @@ -51,7 +49,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -59,13 +56,11 @@ def self.mapper() } }, credentials: { - client_side_validation: true, required: true, serialized_name: 'credentials', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -75,7 +70,6 @@ def self.mapper() } }, is_buffered: { - client_side_validation: true, required: false, serialized_name: 'isBuffered', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_response.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_response.rb index cbb0b0376b..555d2899ec 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_response.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_response.rb @@ -40,7 +40,6 @@ class LoggerResponse # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'LoggerResponse', type: { @@ -48,7 +47,6 @@ def self.mapper() class_name: 'LoggerResponse', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -57,7 +55,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: true, is_constant: true, serialized_name: 'type', @@ -67,7 +64,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -78,13 +74,11 @@ def self.mapper() } }, credentials: { - client_side_validation: true, required: true, serialized_name: 'credentials', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -94,7 +88,6 @@ def self.mapper() } }, is_buffered: { - client_side_validation: true, required: false, serialized_name: 'isBuffered', default_value: true, diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_update_parameters.rb index 20947126fc..b007035260 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/logger_update_parameters.rb @@ -32,7 +32,6 @@ class LoggerUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'LoggerUpdateParameters', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'LoggerUpdateParameters', model_properties: { type: { - client_side_validation: true, required: true, is_constant: true, serialized_name: 'type', @@ -50,7 +48,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -58,13 +55,11 @@ def self.mapper() } }, credentials: { - client_side_validation: true, required: false, serialized_name: 'credentials', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -74,7 +69,6 @@ def self.mapper() } }, is_buffered: { - client_side_validation: true, required: false, serialized_name: 'isBuffered', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb index ad0554b5c5..8a1fedf172 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb @@ -25,7 +25,6 @@ class OAuth2AuthenticationSettingsContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OAuth2AuthenticationSettingsContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'OAuth2AuthenticationSettingsContract', model_properties: { authorization_server_id: { - client_side_validation: true, required: false, serialized_name: 'authorizationServerId', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, scope: { - client_side_validation: true, required: false, serialized_name: 'scope', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authorization_server_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authorization_server_contract.rb index a8813e076c..40e3537d36 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authorization_server_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authorization_server_contract.rb @@ -98,7 +98,6 @@ class OAuth2AuthorizationServerContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OAuth2AuthorizationServerContract', type: { @@ -106,7 +105,6 @@ def self.mapper() class_name: 'OAuth2AuthorizationServerContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -115,7 +113,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -127,7 +124,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -135,7 +131,6 @@ def self.mapper() } }, client_registration_endpoint: { - client_side_validation: true, required: true, serialized_name: 'clientRegistrationEndpoint', type: { @@ -143,7 +138,6 @@ def self.mapper() } }, authorization_endpoint: { - client_side_validation: true, required: true, serialized_name: 'authorizationEndpoint', type: { @@ -151,13 +145,11 @@ def self.mapper() } }, authorization_methods: { - client_side_validation: true, required: false, serialized_name: 'authorizationMethods', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'MethodContractElementType', type: { @@ -168,13 +160,11 @@ def self.mapper() } }, client_authentication_method: { - client_side_validation: true, required: false, serialized_name: 'clientAuthenticationMethod', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ClientAuthenticationMethodContractElementType', type: { @@ -185,13 +175,11 @@ def self.mapper() } }, token_body_parameters: { - client_side_validation: true, required: false, serialized_name: 'tokenBodyParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'TokenBodyParameterContractElementType', type: { @@ -202,7 +190,6 @@ def self.mapper() } }, token_endpoint: { - client_side_validation: true, required: false, serialized_name: 'tokenEndpoint', type: { @@ -210,7 +197,6 @@ def self.mapper() } }, support_state: { - client_side_validation: true, required: false, serialized_name: 'supportState', type: { @@ -218,7 +204,6 @@ def self.mapper() } }, default_scope: { - client_side_validation: true, required: false, serialized_name: 'defaultScope', type: { @@ -226,13 +211,11 @@ def self.mapper() } }, grant_types: { - client_side_validation: true, required: true, serialized_name: 'grantTypes', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'GrantTypesContractElementType', type: { @@ -243,13 +226,11 @@ def self.mapper() } }, bearer_token_sending_methods: { - client_side_validation: true, required: false, serialized_name: 'bearerTokenSendingMethods', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'BearerTokenSendingMethodsContractElementType', type: { @@ -260,7 +241,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: true, serialized_name: 'clientId', type: { @@ -268,7 +248,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { @@ -276,7 +255,6 @@ def self.mapper() } }, resource_owner_username: { - client_side_validation: true, required: false, serialized_name: 'resourceOwnerUsername', type: { @@ -284,7 +262,6 @@ def self.mapper() } }, resource_owner_password: { - client_side_validation: true, required: false, serialized_name: 'resourceOwnerPassword', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authorization_server_update_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authorization_server_update_contract.rb index 58a60efc05..896085f1bd 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authorization_server_update_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/oauth2authorization_server_update_contract.rb @@ -92,7 +92,6 @@ class OAuth2AuthorizationServerUpdateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OAuth2AuthorizationServerUpdateContract', type: { @@ -100,7 +99,6 @@ def self.mapper() class_name: 'OAuth2AuthorizationServerUpdateContract', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -112,7 +110,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -120,7 +117,6 @@ def self.mapper() } }, client_registration_endpoint: { - client_side_validation: true, required: false, serialized_name: 'clientRegistrationEndpoint', type: { @@ -128,7 +124,6 @@ def self.mapper() } }, authorization_endpoint: { - client_side_validation: true, required: false, serialized_name: 'authorizationEndpoint', type: { @@ -136,13 +131,11 @@ def self.mapper() } }, authorization_methods: { - client_side_validation: true, required: false, serialized_name: 'authorizationMethods', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'MethodContractElementType', type: { @@ -153,13 +146,11 @@ def self.mapper() } }, client_authentication_method: { - client_side_validation: true, required: false, serialized_name: 'clientAuthenticationMethod', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ClientAuthenticationMethodContractElementType', type: { @@ -170,13 +161,11 @@ def self.mapper() } }, token_body_parameters: { - client_side_validation: true, required: false, serialized_name: 'tokenBodyParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'TokenBodyParameterContractElementType', type: { @@ -187,7 +176,6 @@ def self.mapper() } }, token_endpoint: { - client_side_validation: true, required: false, serialized_name: 'tokenEndpoint', type: { @@ -195,7 +183,6 @@ def self.mapper() } }, support_state: { - client_side_validation: true, required: false, serialized_name: 'supportState', type: { @@ -203,7 +190,6 @@ def self.mapper() } }, default_scope: { - client_side_validation: true, required: false, serialized_name: 'defaultScope', type: { @@ -211,13 +197,11 @@ def self.mapper() } }, grant_types: { - client_side_validation: true, required: false, serialized_name: 'grantTypes', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'GrantTypesContractElementType', type: { @@ -228,13 +212,11 @@ def self.mapper() } }, bearer_token_sending_methods: { - client_side_validation: true, required: false, serialized_name: 'bearerTokenSendingMethods', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'BearerTokenSendingMethodsContractElementType', type: { @@ -245,7 +227,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: false, serialized_name: 'clientId', type: { @@ -253,7 +234,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { @@ -261,7 +241,6 @@ def self.mapper() } }, resource_owner_username: { - client_side_validation: true, required: false, serialized_name: 'resourceOwnerUsername', type: { @@ -269,7 +248,6 @@ def self.mapper() } }, resource_owner_password: { - client_side_validation: true, required: false, serialized_name: 'resourceOwnerPassword', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb index 952a85bcfb..da359dbcef 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OpenIdConnectProviderCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'OpenIdConnectProviderCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'OpenidConnectProviderContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb index 99d6ed1e84..4972b2c3b5 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb @@ -39,7 +39,6 @@ class OpenidConnectProviderContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OpenidConnectProviderContract', type: { @@ -47,7 +46,6 @@ def self.mapper() class_name: 'OpenidConnectProviderContract', model_properties: { id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { @@ -55,7 +53,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -66,7 +63,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -74,7 +70,6 @@ def self.mapper() } }, metadata_endpoint: { - client_side_validation: true, required: true, serialized_name: 'metadataEndpoint', type: { @@ -82,7 +77,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: true, serialized_name: 'clientId', type: { @@ -90,7 +84,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_create_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_create_contract.rb index a4720e6bc7..071eaf1c8a 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_create_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_create_contract.rb @@ -36,7 +36,6 @@ class OpenidConnectProviderCreateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OpenidConnectProviderCreateContract', type: { @@ -44,7 +43,6 @@ def self.mapper() class_name: 'OpenidConnectProviderCreateContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -55,7 +53,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -63,7 +60,6 @@ def self.mapper() } }, metadata_endpoint: { - client_side_validation: true, required: true, serialized_name: 'metadataEndpoint', type: { @@ -71,7 +67,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: true, serialized_name: 'clientId', type: { @@ -79,7 +74,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb index ce8b558e60..9ae819d13b 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb @@ -36,7 +36,6 @@ class OpenidConnectProviderUpdateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OpenidConnectProviderUpdateContract', type: { @@ -44,7 +43,6 @@ def self.mapper() class_name: 'OpenidConnectProviderUpdateContract', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -55,7 +53,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -63,7 +60,6 @@ def self.mapper() } }, metadata_endpoint: { - client_side_validation: true, required: false, serialized_name: 'metadataEndpoint', type: { @@ -71,7 +67,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: false, serialized_name: 'clientId', type: { @@ -79,7 +74,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_collection.rb index 6e32284373..1c6275dbcf 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'OperationCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'OperationContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_contract.rb index 875284c6fb..6e366f0a7b 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_contract.rb @@ -51,7 +51,6 @@ class OperationContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationContract', type: { @@ -59,7 +58,6 @@ def self.mapper() class_name: 'OperationContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -68,7 +66,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -80,7 +77,6 @@ def self.mapper() } }, method: { - client_side_validation: true, required: true, serialized_name: 'method', type: { @@ -88,7 +84,6 @@ def self.mapper() } }, url_template: { - client_side_validation: true, required: true, serialized_name: 'urlTemplate', constraints: { @@ -100,13 +95,11 @@ def self.mapper() } }, template_parameters: { - client_side_validation: true, required: false, serialized_name: 'templateParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ParameterContractElementType', type: { @@ -117,7 +110,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -128,7 +120,6 @@ def self.mapper() } }, request: { - client_side_validation: true, required: false, serialized_name: 'request', type: { @@ -137,13 +128,11 @@ def self.mapper() } }, responses: { - client_side_validation: true, required: false, serialized_name: 'responses', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ResultContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_result_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_result_contract.rb index 548f581fdf..651fe4696a 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_result_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/operation_result_contract.rb @@ -44,7 +44,6 @@ class OperationResultContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationResultContract', type: { @@ -52,7 +51,6 @@ def self.mapper() class_name: 'OperationResultContract', model_properties: { id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { @@ -60,7 +58,6 @@ def self.mapper() } }, status: { - client_side_validation: true, required: false, serialized_name: 'status', type: { @@ -69,7 +66,6 @@ def self.mapper() } }, started: { - client_side_validation: true, required: false, serialized_name: 'started', type: { @@ -77,7 +73,6 @@ def self.mapper() } }, updated: { - client_side_validation: true, required: false, serialized_name: 'updated', type: { @@ -85,7 +80,6 @@ def self.mapper() } }, result_info: { - client_side_validation: true, required: false, serialized_name: 'resultInfo', type: { @@ -93,7 +87,6 @@ def self.mapper() } }, error: { - client_side_validation: true, required: false, serialized_name: 'error', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/parameter_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/parameter_contract.rb index c65b1b70bf..1338284b89 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/parameter_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/parameter_contract.rb @@ -37,7 +37,6 @@ class ParameterContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ParameterContract', type: { @@ -45,7 +44,6 @@ def self.mapper() class_name: 'ParameterContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { @@ -53,7 +51,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -61,7 +58,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: true, serialized_name: 'type', type: { @@ -69,7 +65,6 @@ def self.mapper() } }, default_value: { - client_side_validation: true, required: false, serialized_name: 'defaultValue', type: { @@ -77,7 +72,6 @@ def self.mapper() } }, required: { - client_side_validation: true, required: false, serialized_name: 'required', type: { @@ -85,13 +79,11 @@ def self.mapper() } }, values: { - client_side_validation: true, required: false, serialized_name: 'values', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/patch_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/patch_parameters.rb index 6634f91a47..7e93976ca8 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/patch_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/patch_parameters.rb @@ -22,7 +22,6 @@ class PatchParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PatchParameters', type: { @@ -30,7 +29,6 @@ def self.mapper() class_name: 'PatchParameters', model_properties: { raw_json: { - client_side_validation: true, required: true, serialized_name: 'RawJson', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb index eb701f70d4..8e627b4ccf 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb @@ -32,7 +32,6 @@ class PolicySnippetContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PolicySnippetContract', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'PolicySnippetContract', model_properties: { name: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'name', @@ -49,7 +47,6 @@ def self.mapper() } }, content: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'content', @@ -58,7 +55,6 @@ def self.mapper() } }, tool_tip: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'toolTip', @@ -67,7 +63,6 @@ def self.mapper() } }, scope: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'scope', diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_collection.rb index 4bc6f3aea8..dacb2d6868 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ProductCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'ProductCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ProductContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_contract.rb index 835d42958a..531d54cb4c 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_contract.rb @@ -67,7 +67,6 @@ class ProductContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ProductContract', type: { @@ -75,7 +74,6 @@ def self.mapper() class_name: 'ProductContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -84,7 +82,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -96,7 +93,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -108,7 +104,6 @@ def self.mapper() } }, terms: { - client_side_validation: true, required: false, serialized_name: 'terms', type: { @@ -116,7 +111,6 @@ def self.mapper() } }, subscription_required: { - client_side_validation: true, required: false, serialized_name: 'subscriptionRequired', default_value: true, @@ -125,7 +119,6 @@ def self.mapper() } }, approval_required: { - client_side_validation: true, required: false, serialized_name: 'approvalRequired', type: { @@ -133,7 +126,6 @@ def self.mapper() } }, subscriptions_limit: { - client_side_validation: true, required: false, serialized_name: 'subscriptionsLimit', type: { @@ -141,7 +133,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', default_value: 'NotPublished', diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_update_parameters.rb index 90114198d1..3193cbe9d1 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/product_update_parameters.rb @@ -58,7 +58,6 @@ class ProductUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ProductUpdateParameters', type: { @@ -66,7 +65,6 @@ def self.mapper() class_name: 'ProductUpdateParameters', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -78,7 +76,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -90,7 +87,6 @@ def self.mapper() } }, terms: { - client_side_validation: true, required: false, serialized_name: 'terms', type: { @@ -98,7 +94,6 @@ def self.mapper() } }, subscription_required: { - client_side_validation: true, required: false, serialized_name: 'subscriptionRequired', type: { @@ -106,7 +101,6 @@ def self.mapper() } }, approval_required: { - client_side_validation: true, required: false, serialized_name: 'approvalRequired', type: { @@ -114,7 +108,6 @@ def self.mapper() } }, subscriptions_limit: { - client_side_validation: true, required: false, serialized_name: 'subscriptionsLimit', type: { @@ -122,7 +115,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_collection.rb index d9a556284a..af3c804861 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PropertyCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'PropertyCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'PropertyContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_contract.rb index 6b60872a42..9aee01f1d9 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_contract.rb @@ -41,7 +41,6 @@ class PropertyContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PropertyContract', type: { @@ -49,7 +48,6 @@ def self.mapper() class_name: 'PropertyContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -58,7 +56,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -71,7 +68,6 @@ def self.mapper() } }, value: { - client_side_validation: true, required: true, serialized_name: 'value', constraints: { @@ -83,7 +79,6 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', constraints: { @@ -92,7 +87,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -102,7 +96,6 @@ def self.mapper() } }, secret: { - client_side_validation: true, required: false, serialized_name: 'secret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_create_parameters.rb index 1cda63e50d..11ed1bf554 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_create_parameters.rb @@ -35,7 +35,6 @@ class PropertyCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PropertyCreateParameters', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'PropertyCreateParameters', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -56,7 +54,6 @@ def self.mapper() } }, value: { - client_side_validation: true, required: true, serialized_name: 'value', constraints: { @@ -68,7 +65,6 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', constraints: { @@ -77,7 +73,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -87,7 +82,6 @@ def self.mapper() } }, secret: { - client_side_validation: true, required: false, serialized_name: 'secret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_update_parameters.rb index f611535499..c27fd75794 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/property_update_parameters.rb @@ -35,7 +35,6 @@ class PropertyUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PropertyUpdateParameters', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'PropertyUpdateParameters', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -56,7 +54,6 @@ def self.mapper() } }, value: { - client_side_validation: true, required: false, serialized_name: 'value', constraints: { @@ -68,7 +65,6 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', constraints: { @@ -77,7 +73,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -87,7 +82,6 @@ def self.mapper() } }, secret: { - client_side_validation: true, required: false, serialized_name: 'secret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_collection.rb index 7921b02294..00d9d51ae4 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_collection.rb @@ -28,7 +28,6 @@ class QuotaCounterCollection # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'QuotaCounterCollection', type: { @@ -36,13 +35,11 @@ def self.mapper() class_name: 'QuotaCounterCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'QuotaCounterContractElementType', type: { @@ -53,7 +50,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -61,7 +57,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_contract.rb index f59367c95c..e34c152ddd 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_contract.rb @@ -38,7 +38,6 @@ class QuotaCounterContract < QuotaCounterValueContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'QuotaCounterContract', type: { @@ -46,7 +45,6 @@ def self.mapper() class_name: 'QuotaCounterContract', model_properties: { calls_count: { - client_side_validation: true, required: false, serialized_name: 'callsCount', type: { @@ -54,7 +52,6 @@ def self.mapper() } }, kb_transferred: { - client_side_validation: true, required: false, serialized_name: 'kbTransferred', type: { @@ -62,7 +59,6 @@ def self.mapper() } }, counter_key: { - client_side_validation: true, required: true, serialized_name: 'counterKey', constraints: { @@ -73,7 +69,6 @@ def self.mapper() } }, period_key: { - client_side_validation: true, required: true, serialized_name: 'periodKey', constraints: { @@ -84,7 +79,6 @@ def self.mapper() } }, period_start_time: { - client_side_validation: true, required: true, serialized_name: 'periodStartTime', type: { @@ -92,7 +86,6 @@ def self.mapper() } }, period_end_time: { - client_side_validation: true, required: true, serialized_name: 'periodEndTime', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb index 2cd84ca5f6..816d30e0a4 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb @@ -25,7 +25,6 @@ class QuotaCounterValueContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'QuotaCounterValueContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'QuotaCounterValueContract', model_properties: { calls_count: { - client_side_validation: true, required: false, serialized_name: 'callsCount', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, kb_transferred: { - client_side_validation: true, required: false, serialized_name: 'kbTransferred', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/region_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/region_contract.rb index 7ca7ff8f21..81e1d79956 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/region_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/region_contract.rb @@ -25,7 +25,6 @@ class RegionContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'RegionContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'RegionContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, is_master_region: { - client_side_validation: true, required: true, serialized_name: 'isMasterRegion', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/region_list_result.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/region_list_result.rb index 22c3763760..b8a9031643 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/region_list_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/region_list_result.rb @@ -22,7 +22,6 @@ class RegionListResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'RegionListResult', type: { @@ -30,13 +29,11 @@ def self.mapper() class_name: 'RegionListResult', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'RegionContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/report_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/report_collection.rb index a2737cafa5..37d1f92e35 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/report_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/report_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ReportCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'ReportCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ReportRecordContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/report_record_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/report_record_contract.rb index a9b467eeab..8c03802925 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/report_record_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/report_record_contract.rb @@ -105,7 +105,6 @@ class ReportRecordContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ReportRecordContract', type: { @@ -113,7 +112,6 @@ def self.mapper() class_name: 'ReportRecordContract', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', type: { @@ -121,7 +119,6 @@ def self.mapper() } }, timestamp: { - client_side_validation: true, required: false, serialized_name: 'timestamp', type: { @@ -129,7 +126,6 @@ def self.mapper() } }, interval: { - client_side_validation: true, required: false, serialized_name: 'interval', type: { @@ -137,7 +133,6 @@ def self.mapper() } }, country: { - client_side_validation: true, required: false, serialized_name: 'country', type: { @@ -145,7 +140,6 @@ def self.mapper() } }, region: { - client_side_validation: true, required: false, serialized_name: 'region', type: { @@ -153,7 +147,6 @@ def self.mapper() } }, zip: { - client_side_validation: true, required: false, serialized_name: 'zip', type: { @@ -161,7 +154,6 @@ def self.mapper() } }, user_id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'userId', @@ -170,7 +162,6 @@ def self.mapper() } }, product_id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'productId', @@ -179,7 +170,6 @@ def self.mapper() } }, api_id: { - client_side_validation: true, required: false, serialized_name: 'apiId', type: { @@ -187,7 +177,6 @@ def self.mapper() } }, operation_id: { - client_side_validation: true, required: false, serialized_name: 'operationId', type: { @@ -195,7 +184,6 @@ def self.mapper() } }, api_region: { - client_side_validation: true, required: false, serialized_name: 'apiRegion', type: { @@ -203,7 +191,6 @@ def self.mapper() } }, subscription_id: { - client_side_validation: true, required: false, serialized_name: 'subscriptionId', type: { @@ -211,7 +198,6 @@ def self.mapper() } }, call_count_success: { - client_side_validation: true, required: false, serialized_name: 'callCountSuccess', type: { @@ -219,7 +205,6 @@ def self.mapper() } }, call_count_blocked: { - client_side_validation: true, required: false, serialized_name: 'callCountBlocked', type: { @@ -227,7 +212,6 @@ def self.mapper() } }, call_count_failed: { - client_side_validation: true, required: false, serialized_name: 'callCountFailed', type: { @@ -235,7 +219,6 @@ def self.mapper() } }, call_count_other: { - client_side_validation: true, required: false, serialized_name: 'callCountOther', type: { @@ -243,7 +226,6 @@ def self.mapper() } }, call_count_total: { - client_side_validation: true, required: false, serialized_name: 'callCountTotal', type: { @@ -251,7 +233,6 @@ def self.mapper() } }, bandwidth: { - client_side_validation: true, required: false, serialized_name: 'bandwidth', type: { @@ -259,7 +240,6 @@ def self.mapper() } }, cache_hit_count: { - client_side_validation: true, required: false, serialized_name: 'cacheHitCount', type: { @@ -267,7 +247,6 @@ def self.mapper() } }, cache_miss_count: { - client_side_validation: true, required: false, serialized_name: 'cacheMissCount', type: { @@ -275,7 +254,6 @@ def self.mapper() } }, api_time_avg: { - client_side_validation: true, required: false, serialized_name: 'apiTimeAvg', type: { @@ -283,7 +261,6 @@ def self.mapper() } }, api_time_min: { - client_side_validation: true, required: false, serialized_name: 'apiTimeMin', type: { @@ -291,7 +268,6 @@ def self.mapper() } }, api_time_max: { - client_side_validation: true, required: false, serialized_name: 'apiTimeMax', type: { @@ -299,7 +275,6 @@ def self.mapper() } }, service_time_avg: { - client_side_validation: true, required: false, serialized_name: 'serviceTimeAvg', type: { @@ -307,7 +282,6 @@ def self.mapper() } }, service_time_min: { - client_side_validation: true, required: false, serialized_name: 'serviceTimeMin', type: { @@ -315,7 +289,6 @@ def self.mapper() } }, service_time_max: { - client_side_validation: true, required: false, serialized_name: 'serviceTimeMax', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/representation_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/representation_contract.rb index b5078bb7e9..cbb43a909d 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/representation_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/representation_contract.rb @@ -26,7 +26,6 @@ class RepresentationContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'RepresentationContract', type: { @@ -34,7 +33,6 @@ def self.mapper() class_name: 'RepresentationContract', model_properties: { content_type: { - client_side_validation: true, required: true, serialized_name: 'contentType', type: { @@ -42,7 +40,6 @@ def self.mapper() } }, sample: { - client_side_validation: true, required: false, serialized_name: 'sample', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/request_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/request_contract.rb index f4ec72e169..ad7e2c406c 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/request_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/request_contract.rb @@ -34,7 +34,6 @@ class RequestContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'RequestContract', type: { @@ -42,7 +41,6 @@ def self.mapper() class_name: 'RequestContract', model_properties: { description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -50,13 +48,11 @@ def self.mapper() } }, query_parameters: { - client_side_validation: true, required: false, serialized_name: 'queryParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ParameterContractElementType', type: { @@ -67,13 +63,11 @@ def self.mapper() } }, headers: { - client_side_validation: true, required: false, serialized_name: 'headers', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ParameterContractElementType', type: { @@ -84,13 +78,11 @@ def self.mapper() } }, representations: { - client_side_validation: true, required: false, serialized_name: 'representations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'RepresentationContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/result_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/result_contract.rb index 7a90170c79..3912e5a4a4 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/result_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/result_contract.rb @@ -29,7 +29,6 @@ class ResultContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ResultContract', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'ResultContract', model_properties: { status_code: { - client_side_validation: true, required: true, serialized_name: 'statusCode', constraints: { @@ -49,7 +47,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -57,13 +54,11 @@ def self.mapper() } }, representations: { - client_side_validation: true, required: false, serialized_name: 'representations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'RepresentationContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb index 6036d88bf7..106303f56e 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb @@ -28,7 +28,6 @@ class SaveConfigurationParameter # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SaveConfigurationParameter', type: { @@ -36,7 +35,6 @@ def self.mapper() class_name: 'SaveConfigurationParameter', model_properties: { branch: { - client_side_validation: true, required: true, serialized_name: 'branch', type: { @@ -44,7 +42,6 @@ def self.mapper() } }, force: { - client_side_validation: true, required: false, serialized_name: 'force', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_collection.rb index 81426c10e3..5dcf209acb 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'SubscriptionCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'SubscriptionContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_contract.rb index 6c07b917db..0b9388f873 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_contract.rb @@ -91,7 +91,6 @@ class SubscriptionContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionContract', type: { @@ -99,7 +98,6 @@ def self.mapper() class_name: 'SubscriptionContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -108,7 +106,6 @@ def self.mapper() } }, user_id: { - client_side_validation: true, required: false, serialized_name: 'userId', type: { @@ -116,7 +113,6 @@ def self.mapper() } }, product_id: { - client_side_validation: true, required: false, serialized_name: 'productId', type: { @@ -124,7 +120,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -136,7 +131,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { @@ -145,7 +139,6 @@ def self.mapper() } }, created_date: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'createdDate', @@ -154,7 +147,6 @@ def self.mapper() } }, start_date: { - client_side_validation: true, required: false, serialized_name: 'startDate', type: { @@ -162,7 +154,6 @@ def self.mapper() } }, expiration_date: { - client_side_validation: true, required: false, serialized_name: 'expirationDate', type: { @@ -170,7 +161,6 @@ def self.mapper() } }, end_date: { - client_side_validation: true, required: false, serialized_name: 'endDate', type: { @@ -178,7 +168,6 @@ def self.mapper() } }, notification_date: { - client_side_validation: true, required: false, serialized_name: 'notificationDate', type: { @@ -186,7 +175,6 @@ def self.mapper() } }, primary_key: { - client_side_validation: true, required: false, serialized_name: 'primaryKey', constraints: { @@ -198,7 +186,6 @@ def self.mapper() } }, secondary_key: { - client_side_validation: true, required: false, serialized_name: 'secondaryKey', constraints: { @@ -210,7 +197,6 @@ def self.mapper() } }, state_comment: { - client_side_validation: true, required: false, serialized_name: 'stateComment', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb index 01ef84c685..2ae2242c2c 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb @@ -51,7 +51,6 @@ class SubscriptionCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionCreateParameters', type: { @@ -59,7 +58,6 @@ def self.mapper() class_name: 'SubscriptionCreateParameters', model_properties: { user_id: { - client_side_validation: true, required: true, serialized_name: 'userId', type: { @@ -67,7 +65,6 @@ def self.mapper() } }, product_id: { - client_side_validation: true, required: true, serialized_name: 'productId', type: { @@ -75,7 +72,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -87,7 +83,6 @@ def self.mapper() } }, primary_key: { - client_side_validation: true, required: false, serialized_name: 'primaryKey', constraints: { @@ -99,7 +94,6 @@ def self.mapper() } }, secondary_key: { - client_side_validation: true, required: false, serialized_name: 'secondaryKey', constraints: { @@ -111,7 +105,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb index 2188a8764a..0ab6fc9b7a 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb @@ -25,7 +25,6 @@ class SubscriptionKeyParameterNamesContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionKeyParameterNamesContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'SubscriptionKeyParameterNamesContract', model_properties: { header: { - client_side_validation: true, required: false, serialized_name: 'header', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, query: { - client_side_validation: true, required: false, serialized_name: 'query', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb index 398dbca220..90650da6fa 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb @@ -53,7 +53,6 @@ class SubscriptionUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionUpdateParameters', type: { @@ -61,7 +60,6 @@ def self.mapper() class_name: 'SubscriptionUpdateParameters', model_properties: { user_id: { - client_side_validation: true, required: false, serialized_name: 'userId', type: { @@ -69,7 +67,6 @@ def self.mapper() } }, product_id: { - client_side_validation: true, required: false, serialized_name: 'productId', type: { @@ -77,7 +74,6 @@ def self.mapper() } }, expiration_date: { - client_side_validation: true, required: false, serialized_name: 'expirationDate', type: { @@ -85,7 +81,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, serialized_name: 'name', type: { @@ -93,7 +88,6 @@ def self.mapper() } }, primary_key: { - client_side_validation: true, required: false, serialized_name: 'primaryKey', constraints: { @@ -105,7 +99,6 @@ def self.mapper() } }, secondary_key: { - client_side_validation: true, required: false, serialized_name: 'secondaryKey', constraints: { @@ -117,7 +110,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { @@ -126,7 +118,6 @@ def self.mapper() } }, state_comment: { - client_side_validation: true, required: false, serialized_name: 'stateComment', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb index 47ddfdf74e..149de06448 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb @@ -49,7 +49,6 @@ class TenantConfigurationSyncStateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'TenantConfigurationSyncStateContract', type: { @@ -57,7 +56,6 @@ def self.mapper() class_name: 'TenantConfigurationSyncStateContract', model_properties: { branch: { - client_side_validation: true, required: false, serialized_name: 'branch', type: { @@ -65,7 +63,6 @@ def self.mapper() } }, commit_id: { - client_side_validation: true, required: false, serialized_name: 'commitId', type: { @@ -73,7 +70,6 @@ def self.mapper() } }, is_export: { - client_side_validation: true, required: false, serialized_name: 'isExport', type: { @@ -81,7 +77,6 @@ def self.mapper() } }, is_synced: { - client_side_validation: true, required: false, serialized_name: 'isSynced', type: { @@ -89,7 +84,6 @@ def self.mapper() } }, is_git_enabled: { - client_side_validation: true, required: false, serialized_name: 'isGitEnabled', type: { @@ -97,7 +91,6 @@ def self.mapper() } }, sync_date: { - client_side_validation: true, required: false, serialized_name: 'syncDate', type: { @@ -105,7 +98,6 @@ def self.mapper() } }, configuration_change_date: { - client_side_validation: true, required: false, serialized_name: 'configurationChangeDate', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/tenant_long_running_operation_result.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/tenant_long_running_operation_result.rb index 8d83bc0f8d..066a93dd0e 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/tenant_long_running_operation_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/tenant_long_running_operation_result.rb @@ -36,7 +36,6 @@ class TenantLongRunningOperationResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'TenantLongRunningOperationResult', type: { @@ -44,7 +43,6 @@ def self.mapper() class_name: 'TenantLongRunningOperationResult', model_properties: { operation_status_link: { - client_side_validation: true, required: false, serialized_name: 'operationStatusLink', type: { @@ -52,7 +50,6 @@ def self.mapper() } }, retry_after: { - client_side_validation: true, required: false, serialized_name: 'retryAfter', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, status: { - client_side_validation: true, required: false, serialized_name: 'status', type: { @@ -69,7 +65,6 @@ def self.mapper() } }, status_code: { - client_side_validation: true, required: false, serialized_name: 'statusCode', type: { @@ -78,7 +73,6 @@ def self.mapper() } }, request_id: { - client_side_validation: true, required: false, serialized_name: 'requestId', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb index 3889ba143e..c2444080ff 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb @@ -25,7 +25,6 @@ class TokenBodyParameterContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'TokenBodyParameterContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'TokenBodyParameterContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, value: { - client_side_validation: true, required: true, serialized_name: 'value', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_collection.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_collection.rb index 88e296ea96..9b9a0422fb 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'UserCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'UserContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_contract.rb index 2b4ef14cfb..61117c6580 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_contract.rb @@ -47,7 +47,6 @@ class UserContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserContract', type: { @@ -55,7 +54,6 @@ def self.mapper() class_name: 'UserContract', model_properties: { id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { @@ -63,7 +61,6 @@ def self.mapper() } }, first_name: { - client_side_validation: true, required: false, serialized_name: 'firstName', type: { @@ -71,7 +68,6 @@ def self.mapper() } }, last_name: { - client_side_validation: true, required: false, serialized_name: 'lastName', type: { @@ -79,7 +75,6 @@ def self.mapper() } }, email: { - client_side_validation: true, required: false, serialized_name: 'email', type: { @@ -87,7 +82,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { @@ -96,7 +90,6 @@ def self.mapper() } }, registration_date: { - client_side_validation: true, required: false, serialized_name: 'registrationDate', type: { @@ -104,7 +97,6 @@ def self.mapper() } }, note: { - client_side_validation: true, required: false, serialized_name: 'note', type: { @@ -112,14 +104,12 @@ def self.mapper() } }, identities: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'identities', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'UserIdentityContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_create_parameters.rb index 6ff20ac697..79da3ab7bb 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_create_parameters.rb @@ -42,7 +42,6 @@ class UserCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserCreateParameters', type: { @@ -50,7 +49,6 @@ def self.mapper() class_name: 'UserCreateParameters', model_properties: { email: { - client_side_validation: true, required: true, serialized_name: 'email', constraints: { @@ -62,7 +60,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: true, serialized_name: 'password', type: { @@ -70,7 +67,6 @@ def self.mapper() } }, first_name: { - client_side_validation: true, required: true, serialized_name: 'firstName', constraints: { @@ -82,7 +78,6 @@ def self.mapper() } }, last_name: { - client_side_validation: true, required: true, serialized_name: 'lastName', constraints: { @@ -94,7 +89,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', default_value: 'Active', @@ -104,7 +98,6 @@ def self.mapper() } }, note: { - client_side_validation: true, required: false, serialized_name: 'note', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_identity_contract.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_identity_contract.rb index 73220259e3..f43b96047b 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_identity_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_identity_contract.rb @@ -25,7 +25,6 @@ class UserIdentityContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserIdentityContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'UserIdentityContract', model_properties: { provider: { - client_side_validation: true, required: false, serialized_name: 'provider', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_update_parameters.rb index a231dfbb04..e0d91b02ea 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/user_update_parameters.rb @@ -38,7 +38,6 @@ class UserUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserUpdateParameters', type: { @@ -46,7 +45,6 @@ def self.mapper() class_name: 'UserUpdateParameters', model_properties: { email: { - client_side_validation: true, required: false, serialized_name: 'email', type: { @@ -54,7 +52,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: false, serialized_name: 'password', type: { @@ -62,7 +59,6 @@ def self.mapper() } }, first_name: { - client_side_validation: true, required: false, serialized_name: 'firstName', constraints: { @@ -74,7 +70,6 @@ def self.mapper() } }, last_name: { - client_side_validation: true, required: false, serialized_name: 'lastName', constraints: { @@ -86,7 +81,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { @@ -95,7 +89,6 @@ def self.mapper() } }, note: { - client_side_validation: true, required: false, serialized_name: 'note', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb index fad906277b..7e46ded548 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb @@ -35,7 +35,6 @@ class VirtualNetworkConfiguration # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'VirtualNetworkConfiguration', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'VirtualNetworkConfiguration', model_properties: { vnetid: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'vnetid', @@ -52,7 +50,6 @@ def self.mapper() } }, subnetname: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'subnetname', @@ -61,7 +58,6 @@ def self.mapper() } }, subnet_resource_id: { - client_side_validation: true, required: false, serialized_name: 'subnetResourceId', type: { @@ -69,7 +65,6 @@ def self.mapper() } }, location: { - client_side_validation: true, required: false, serialized_name: 'location', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/open_id_connect_providers.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/open_id_connect_providers.rb index 857e701256..54ed01ec9d 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/open_id_connect_providers.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/open_id_connect_providers.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -87,20 +87,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -156,8 +150,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [OpenidConnectProviderContract] operation results. # - def get(resource_group_name, service_name, opid, custom_headers:nil) - response = get_async(resource_group_name, service_name, opid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, opid, custom_headers = nil) + response = get_async(resource_group_name, service_name, opid, custom_headers).value! response.body unless response.nil? end @@ -172,8 +166,8 @@ def get(resource_group_name, service_name, opid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, opid, custom_headers:nil) - get_async(resource_group_name, service_name, opid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, opid, custom_headers = nil) + get_async(resource_group_name, service_name, opid, custom_headers).value! end # @@ -187,19 +181,15 @@ def get_with_http_info(resource_group_name, service_name, opid, custom_headers:n # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, opid, custom_headers:nil) + def get_async(resource_group_name, service_name, opid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'opid is nil' if opid.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -255,8 +245,8 @@ def get_async(resource_group_name, service_name, opid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, opid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, opid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers).value! nil end @@ -272,8 +262,8 @@ def create_or_update(resource_group_name, service_name, opid, parameters, custom # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, opid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, opid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers).value! end # @@ -288,27 +278,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, opid, par # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'opid is nil' if opid.nil? - fail ArgumentError, "'opid' should satisfy the constraint - 'MaxLength': '256'" if !opid.nil? && opid.length > 256 - fail ArgumentError, "'opid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !opid.nil? && opid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::OpenidConnectProviderCreateContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -359,8 +345,8 @@ def create_or_update_async(resource_group_name, service_name, opid, parameters, # will be added to the HTTP request. # # - def update(resource_group_name, service_name, opid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers).value! nil end @@ -379,8 +365,8 @@ def update(resource_group_name, service_name, opid, parameters, if_match, custom # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, opid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers).value! end # @@ -398,12 +384,9 @@ def update_with_http_info(resource_group_name, service_name, opid, parameters, i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'opid is nil' if opid.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? @@ -412,13 +395,14 @@ def update_async(resource_group_name, service_name, opid, parameters, if_match, request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::OpenidConnectProviderUpdateContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -470,8 +454,8 @@ def update_async(resource_group_name, service_name, opid, parameters, if_match, # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, opid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, opid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, opid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, opid, if_match, custom_headers).value! response.body unless response.nil? end @@ -490,8 +474,8 @@ def delete(resource_group_name, service_name, opid, if_match, custom_headers:nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, opid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, opid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, opid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, opid, if_match, custom_headers).value! end # @@ -509,12 +493,9 @@ def delete_with_http_info(resource_group_name, service_name, opid, if_match, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, opid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, opid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'opid is nil' if opid.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -522,7 +503,6 @@ def delete_async(resource_group_name, service_name, opid, if_match, custom_heade request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -578,8 +558,8 @@ def delete_async(resource_group_name, service_name, opid, if_match, custom_heade # # @return [OpenIdConnectProviderCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -593,8 +573,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -607,12 +587,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -676,12 +655,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [OpenIdConnectProviderCollection] which provide lazy access to pages # of the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/policy_snippets.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/policy_snippets.rb index 75fb2f62ba..ec4a7d1462 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/policy_snippets.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/policy_snippets.rb @@ -33,8 +33,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, scope:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, scope:scope, custom_headers:custom_headers).value! + def list_by_service(resource_group_name, service_name, scope = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, scope, custom_headers).value! response.body unless response.nil? end @@ -50,8 +50,8 @@ def list_by_service(resource_group_name, service_name, scope:nil, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, scope:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, scope:scope, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, scope = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, scope, custom_headers).value! end # @@ -66,18 +66,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, scope:nil, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, scope:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, scope = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -110,13 +106,11 @@ def list_by_service_async(resource_group_name, service_name, scope:nil, custom_h 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: 'PolicySnippetContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_apis.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_apis.rb index 3761564ae0..02743e2a08 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_apis.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_apis.rb @@ -49,8 +49,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_product(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_product(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -82,8 +82,8 @@ def list_by_product(resource_group_name, service_name, product_id, filter:nil, t # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_product_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! end # @@ -114,24 +114,15 @@ def list_by_product_with_http_info(resource_group_name, service_name, product_id # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_product_async(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_product_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -189,8 +180,8 @@ def list_by_product_async(resource_group_name, service_name, product_id, filter: # will be added to the HTTP request. # # - def add(resource_group_name, service_name, product_id, api_id, custom_headers:nil) - response = add_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! + def add(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + response = add_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! nil end @@ -208,8 +199,8 @@ def add(resource_group_name, service_name, product_id, api_id, custom_headers:ni # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def add_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers:nil) - add_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! + def add_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + add_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! end # @@ -226,26 +217,16 @@ def add_with_http_info(resource_group_name, service_name, product_id, api_id, cu # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def add_async(resource_group_name, service_name, product_id, api_id, custom_headers:nil) + def add_async(resource_group_name, service_name, product_id, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -293,8 +274,8 @@ def add_async(resource_group_name, service_name, product_id, api_id, custom_head # will be added to the HTTP request. # # - def remove(resource_group_name, service_name, product_id, api_id, custom_headers:nil) - response = remove_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! + def remove(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + response = remove_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! nil end @@ -312,8 +293,8 @@ def remove(resource_group_name, service_name, product_id, api_id, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def remove_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers:nil) - remove_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! + def remove_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + remove_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! end # @@ -330,26 +311,16 @@ def remove_with_http_info(resource_group_name, service_name, product_id, api_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def remove_async(resource_group_name, service_name, product_id, api_id, custom_headers:nil) + def remove_async(resource_group_name, service_name, product_id, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -394,8 +365,8 @@ def remove_async(resource_group_name, service_name, product_id, api_id, custom_h # # @return [ApiCollection] operation results. # - def list_by_product_next(next_page_link, custom_headers:nil) - response = list_by_product_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_product_next(next_page_link, custom_headers = nil) + response = list_by_product_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -409,8 +380,8 @@ def list_by_product_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_product_next_with_http_info(next_page_link, custom_headers:nil) - list_by_product_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_product_next_with_http_info(next_page_link, custom_headers = nil) + list_by_product_next_async(next_page_link, custom_headers).value! end # @@ -423,12 +394,11 @@ def list_by_product_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_product_next_async(next_page_link, custom_headers:nil) + def list_by_product_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 @@ -500,12 +470,12 @@ def list_by_product_next_async(next_page_link, custom_headers:nil) # # @return [ApiCollection] which provide lazy access to pages of the response. # - def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_product_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_product_next_async(next_page_link, custom_headers:custom_headers) + list_by_product_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_groups.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_groups.rb index 08667ef362..32e1d13fb9 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_groups.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_groups.rb @@ -47,8 +47,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_product(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_product(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -78,8 +78,8 @@ def list_by_product(resource_group_name, service_name, product_id, filter:nil, t # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_product_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! end # @@ -108,24 +108,15 @@ def list_by_product_with_http_info(resource_group_name, service_name, product_id # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_product_async(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_product_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -184,8 +175,8 @@ def list_by_product_async(resource_group_name, service_name, product_id, filter: # will be added to the HTTP request. # # - def add(resource_group_name, service_name, product_id, group_id, custom_headers:nil) - response = add_async(resource_group_name, service_name, product_id, group_id, custom_headers:custom_headers).value! + def add(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + response = add_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! nil end @@ -204,8 +195,8 @@ def add(resource_group_name, service_name, product_id, group_id, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def add_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers:nil) - add_async(resource_group_name, service_name, product_id, group_id, custom_headers:custom_headers).value! + def add_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + add_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! end # @@ -223,26 +214,16 @@ def add_with_http_info(resource_group_name, service_name, product_id, group_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def add_async(resource_group_name, service_name, product_id, group_id, custom_headers:nil) + def add_async(resource_group_name, service_name, product_id, group_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -291,8 +272,8 @@ def add_async(resource_group_name, service_name, product_id, group_id, custom_he # # @return [ErrorBodyContract] operation results. # - def remove(resource_group_name, service_name, product_id, group_id, custom_headers:nil) - response = remove_async(resource_group_name, service_name, product_id, group_id, custom_headers:custom_headers).value! + def remove(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + response = remove_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! response.body unless response.nil? end @@ -310,8 +291,8 @@ def remove(resource_group_name, service_name, product_id, group_id, custom_heade # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def remove_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers:nil) - remove_async(resource_group_name, service_name, product_id, group_id, custom_headers:custom_headers).value! + def remove_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + remove_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! end # @@ -328,26 +309,16 @@ def remove_with_http_info(resource_group_name, service_name, product_id, group_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def remove_async(resource_group_name, service_name, product_id, group_id, custom_headers:nil) + def remove_async(resource_group_name, service_name, product_id, group_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -403,8 +374,8 @@ def remove_async(resource_group_name, service_name, product_id, group_id, custom # # @return [GroupCollection] operation results. # - def list_by_product_next(next_page_link, custom_headers:nil) - response = list_by_product_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_product_next(next_page_link, custom_headers = nil) + response = list_by_product_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -419,8 +390,8 @@ def list_by_product_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_product_next_with_http_info(next_page_link, custom_headers:nil) - list_by_product_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_product_next_with_http_info(next_page_link, custom_headers = nil) + list_by_product_next_async(next_page_link, custom_headers).value! end # @@ -434,12 +405,11 @@ def list_by_product_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_product_next_async(next_page_link, custom_headers:nil) + def list_by_product_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 @@ -509,12 +479,12 @@ def list_by_product_next_async(next_page_link, custom_headers:nil) # # @return [GroupCollection] which provide lazy access to pages of the response. # - def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_product_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_product_next_async(next_page_link, custom_headers:custom_headers) + list_by_product_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_subscriptions.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_subscriptions.rb index 4159babc73..4edc6251c5 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_subscriptions.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_subscriptions.rb @@ -50,8 +50,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_product(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_product(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -84,8 +84,8 @@ def list_by_product(resource_group_name, service_name, product_id, filter:nil, t # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_product_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! end # @@ -117,24 +117,15 @@ def list_by_product_with_http_info(resource_group_name, service_name, product_id # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_product_async(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_product_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -189,8 +180,8 @@ def list_by_product_async(resource_group_name, service_name, product_id, filter: # # @return [SubscriptionCollection] operation results. # - def list_by_product_next(next_page_link, custom_headers:nil) - response = list_by_product_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_product_next(next_page_link, custom_headers = nil) + response = list_by_product_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -204,8 +195,8 @@ def list_by_product_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_product_next_with_http_info(next_page_link, custom_headers:nil) - list_by_product_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_product_next_with_http_info(next_page_link, custom_headers = nil) + list_by_product_next_async(next_page_link, custom_headers).value! end # @@ -218,12 +209,11 @@ def list_by_product_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_product_next_async(next_page_link, custom_headers:nil) + def list_by_product_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 @@ -297,12 +287,12 @@ def list_by_product_next_async(next_page_link, custom_headers:nil) # @return [SubscriptionCollection] which provide lazy access to pages of the # response. # - def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_product_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_product_next_async(next_page_link, custom_headers:custom_headers) + list_by_product_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/products.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/products.rb index 70d013feb6..49fcbb993c 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/products.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/products.rb @@ -48,8 +48,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, expand_groups:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, expand_groups:expand_groups, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers) first_page.get_all_items end @@ -80,8 +80,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, expand_groups:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, expand_groups:expand_groups, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers).value! end # @@ -111,20 +111,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, expand_groups:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -181,8 +175,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [ProductContract] operation results. # - def get(resource_group_name, service_name, product_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, product_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, product_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, product_id, custom_headers).value! response.body unless response.nil? end @@ -198,8 +192,8 @@ def get(resource_group_name, service_name, product_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, product_id, custom_headers:nil) - get_async(resource_group_name, service_name, product_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, product_id, custom_headers = nil) + get_async(resource_group_name, service_name, product_id, custom_headers).value! end # @@ -214,22 +208,15 @@ def get_with_http_info(resource_group_name, service_name, product_id, custom_hea # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, product_id, custom_headers:nil) + def get_async(resource_group_name, service_name, product_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -286,8 +273,8 @@ def get_async(resource_group_name, service_name, product_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, product_id, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, product_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers).value! nil end @@ -304,8 +291,8 @@ def create_or_update(resource_group_name, service_name, product_id, parameters, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, product_id, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, product_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers).value! end # @@ -321,28 +308,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, product_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ProductContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -394,8 +376,8 @@ def create_or_update_async(resource_group_name, service_name, product_id, parame # will be added to the HTTP request. # # - def update(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! nil end @@ -415,8 +397,8 @@ def update(resource_group_name, service_name, product_id, parameters, if_match, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! end # @@ -435,16 +417,10 @@ def update_with_http_info(resource_group_name, service_name, product_id, paramet # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -452,13 +428,14 @@ def update_async(resource_group_name, service_name, product_id, parameters, if_m request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::ProductUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -511,8 +488,8 @@ def update_async(resource_group_name, service_name, product_id, parameters, if_m # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, product_id, if_match, delete_subscriptions:nil, custom_headers:nil) - response = delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions:delete_subscriptions, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions, custom_headers).value! nil end @@ -533,8 +510,8 @@ def delete(resource_group_name, service_name, product_id, if_match, delete_subsc # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, product_id, if_match, delete_subscriptions:nil, custom_headers:nil) - delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions:delete_subscriptions, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions, custom_headers).value! end # @@ -554,23 +531,16 @@ def delete_with_http_info(resource_group_name, service_name, product_id, if_matc # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions:nil, custom_headers:nil) + def delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -616,8 +586,8 @@ def delete_async(resource_group_name, service_name, product_id, if_match, delete # # @return [ProductCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -631,8 +601,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -645,12 +615,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -722,12 +691,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [ProductCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, expand_groups:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, expand_groups:expand_groups, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/property.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/property.rb index e18c32cdfb..c49daeeea6 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/property.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/property.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -87,20 +87,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -156,8 +150,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [PropertyContract] operation results. # - def get(resource_group_name, service_name, prop_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, prop_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, prop_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, prop_id, custom_headers).value! response.body unless response.nil? end @@ -172,8 +166,8 @@ def get(resource_group_name, service_name, prop_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, prop_id, custom_headers:nil) - get_async(resource_group_name, service_name, prop_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, prop_id, custom_headers = nil) + get_async(resource_group_name, service_name, prop_id, custom_headers).value! end # @@ -187,19 +181,15 @@ def get_with_http_info(resource_group_name, service_name, prop_id, custom_header # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, prop_id, custom_headers:nil) + def get_async(resource_group_name, service_name, prop_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'prop_id is nil' if prop_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -255,8 +245,8 @@ def get_async(resource_group_name, service_name, prop_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, prop_id, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, prop_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers).value! nil end @@ -272,8 +262,8 @@ def create_or_update(resource_group_name, service_name, prop_id, parameters, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, prop_id, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, prop_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers).value! end # @@ -288,27 +278,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, prop_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'prop_id is nil' if prop_id.nil? - fail ArgumentError, "'prop_id' should satisfy the constraint - 'MaxLength': '256'" if !prop_id.nil? && prop_id.length > 256 - fail ArgumentError, "'prop_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !prop_id.nil? && prop_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::PropertyCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -359,8 +345,8 @@ def create_or_update_async(resource_group_name, service_name, prop_id, parameter # will be added to the HTTP request. # # - def update(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers).value! nil end @@ -379,8 +365,8 @@ def update(resource_group_name, service_name, prop_id, parameters, if_match, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers).value! end # @@ -398,12 +384,9 @@ def update_with_http_info(resource_group_name, service_name, prop_id, parameters # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'prop_id is nil' if prop_id.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? @@ -412,13 +395,14 @@ def update_async(resource_group_name, service_name, prop_id, parameters, if_matc request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::PropertyUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -469,8 +453,8 @@ def update_async(resource_group_name, service_name, prop_id, parameters, if_matc # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, prop_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers).value! response.body unless response.nil? end @@ -488,8 +472,8 @@ def delete(resource_group_name, service_name, prop_id, if_match, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, prop_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers).value! end # @@ -506,12 +490,9 @@ def delete_with_http_info(resource_group_name, service_name, prop_id, if_match, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'prop_id is nil' if prop_id.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -519,7 +500,6 @@ def delete_async(resource_group_name, service_name, prop_id, if_match, custom_he request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -575,8 +555,8 @@ def delete_async(resource_group_name, service_name, prop_id, if_match, custom_he # # @return [PropertyCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -590,8 +570,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -604,12 +584,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -673,12 +652,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [PropertyCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/quota_by_counter_keys.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/quota_by_counter_keys.rb index cbdaf95df1..647f16385d 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/quota_by_counter_keys.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/quota_by_counter_keys.rb @@ -34,8 +34,8 @@ def initialize(client) # # @return [QuotaCounterCollection] operation results. # - def list_by_service(resource_group_name, service_name, quota_counter_key, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers:custom_headers).value! + def list_by_service(resource_group_name, service_name, quota_counter_key, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers).value! response.body unless response.nil? end @@ -52,8 +52,8 @@ def list_by_service(resource_group_name, service_name, quota_counter_key, custom # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, quota_counter_key, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, quota_counter_key, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers).value! end # @@ -69,19 +69,15 @@ def list_by_service_with_http_info(resource_group_name, service_name, quota_coun # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, quota_counter_key, 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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.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 @@ -140,8 +136,8 @@ def list_by_service_async(resource_group_name, service_name, quota_counter_key, # will be added to the HTTP request. # # - def update(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:nil) - response = update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers).value! nil end @@ -160,8 +156,8 @@ def update(resource_group_name, service_name, quota_counter_key, parameters, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:nil) - update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) + update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers).value! end # @@ -179,12 +175,9 @@ def update_with_http_info(resource_group_name, service_name, quota_counter_key, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:nil) + def update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -192,12 +185,13 @@ def update_async(resource_group_name, service_name, quota_counter_key, parameter 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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::QuotaCounterValueContract.mapper() request_content = @client.serialize(request_mapper, parameters) diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/quota_by_period_keys.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/quota_by_period_keys.rb index 07f0c39093..15389c1e73 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/quota_by_period_keys.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/quota_by_period_keys.rb @@ -34,8 +34,8 @@ def initialize(client) # # @return [QuotaCounterContract] operation results. # - def get(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:nil) - response = get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers = nil) + response = get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers).value! response.body unless response.nil? end @@ -52,8 +52,8 @@ def get(resource_group_name, service_name, quota_counter_key, quota_period_key, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:nil) - get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers = nil) + get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers).value! end # @@ -69,20 +69,16 @@ def get_with_http_info(resource_group_name, service_name, quota_counter_key, quo # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:nil) + def get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, 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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? fail ArgumentError, 'quota_period_key is nil' if quota_period_key.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 @@ -140,8 +136,8 @@ def get_async(resource_group_name, service_name, quota_counter_key, quota_period # will be added to the HTTP request. # # - def update(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:nil) - response = update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers).value! nil end @@ -159,8 +155,8 @@ def update(resource_group_name, service_name, quota_counter_key, quota_period_ke # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:nil) - update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) + update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers).value! end # @@ -177,12 +173,9 @@ def update_with_http_info(resource_group_name, service_name, quota_counter_key, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:nil) + def update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? fail ArgumentError, 'quota_period_key is nil' if quota_period_key.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? @@ -191,12 +184,13 @@ def update_async(resource_group_name, service_name, quota_counter_key, quota_per 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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::QuotaCounterValueContract.mapper() request_content = @client.serialize(request_mapper, parameters) diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/regions.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/regions.rb index c37dac50ed..069447f558 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/regions.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/regions.rb @@ -31,8 +31,8 @@ def initialize(client) # # @return [RegionListResult] operation results. # - def list_by_service(resource_group_name, service_name, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def list_by_service(resource_group_name, service_name, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -46,8 +46,8 @@ def list_by_service(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, custom_headers).value! end # @@ -60,18 +60,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, custom_hea # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/reports.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/reports.rb index cd1fc2e676..7356f53bd0 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/reports.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/reports.rb @@ -43,8 +43,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, aggregation, filter:nil, top:nil, skip:nil, interval:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, aggregation, filter:filter, top:top, skip:skip, interval:interval, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, aggregation, filter = nil, top = nil, skip = nil, interval = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, aggregation, filter, top, skip, interval, custom_headers) first_page.get_all_items end @@ -70,8 +70,8 @@ def list_by_service(resource_group_name, service_name, aggregation, filter:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, aggregation, filter:nil, top:nil, skip:nil, interval:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, aggregation, filter:filter, top:top, skip:skip, interval:interval, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, aggregation, filter = nil, top = nil, skip = nil, interval = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, aggregation, filter, top, skip, interval, custom_headers).value! end # @@ -96,21 +96,15 @@ def list_by_service_with_http_info(resource_group_name, service_name, aggregatio # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, aggregation, filter:nil, top:nil, skip:nil, interval:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, aggregation, filter = nil, top = nil, skip = nil, interval = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'aggregation is nil' if aggregation.nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -165,8 +159,8 @@ def list_by_service_async(resource_group_name, service_name, aggregation, filter # # @return [ReportCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -180,8 +174,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -194,12 +188,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -266,12 +259,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [ReportCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, aggregation, filter:nil, top:nil, skip:nil, interval:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, aggregation, filter:filter, top:top, skip:skip, interval:interval, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, aggregation, filter = nil, top = nil, skip = nil, interval = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, aggregation, filter, top, skip, interval, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/subscriptions.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/subscriptions.rb index 27a05c193e..03defef9cb 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/subscriptions.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/subscriptions.rb @@ -48,8 +48,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -80,8 +80,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -111,20 +111,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -180,8 +174,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [SubscriptionContract] operation results. # - def get(resource_group_name, service_name, sid, custom_headers:nil) - response = get_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, sid, custom_headers = nil) + response = get_async(resource_group_name, service_name, sid, custom_headers).value! response.body unless response.nil? end @@ -196,8 +190,8 @@ def get(resource_group_name, service_name, sid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, sid, custom_headers:nil) - get_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + get_async(resource_group_name, service_name, sid, custom_headers).value! end # @@ -211,19 +205,15 @@ def get_with_http_info(resource_group_name, service_name, sid, custom_headers:ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, sid, custom_headers:nil) + def get_async(resource_group_name, service_name, sid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -280,8 +270,8 @@ def get_async(resource_group_name, service_name, sid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, sid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, sid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers).value! nil end @@ -298,8 +288,8 @@ def create_or_update(resource_group_name, service_name, sid, parameters, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, sid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, sid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers).value! end # @@ -315,28 +305,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, sid, para # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? - fail ArgumentError, "'sid' should satisfy the constraint - 'MaxLength': '256'" if !sid.nil? && sid.length > 256 - fail ArgumentError, "'sid' should satisfy the constraint - 'MinLength': '1'" if !sid.nil? && sid.length < 1 - fail ArgumentError, "'sid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !sid.nil? && sid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::SubscriptionCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -387,8 +372,8 @@ def create_or_update_async(resource_group_name, service_name, sid, parameters, c # will be added to the HTTP request. # # - def update(resource_group_name, service_name, sid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, sid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers).value! nil end @@ -407,8 +392,8 @@ def update(resource_group_name, service_name, sid, parameters, if_match, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, sid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, sid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers).value! end # @@ -426,12 +411,9 @@ def update_with_http_info(resource_group_name, service_name, sid, parameters, if # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? @@ -440,13 +422,14 @@ def update_async(resource_group_name, service_name, sid, parameters, if_match, c request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::SubscriptionUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -496,8 +479,8 @@ def update_async(resource_group_name, service_name, sid, parameters, if_match, c # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, sid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, sid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, sid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, sid, if_match, custom_headers).value! nil end @@ -515,8 +498,8 @@ def delete(resource_group_name, service_name, sid, if_match, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, sid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, sid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, sid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, sid, if_match, custom_headers).value! end # @@ -533,12 +516,9 @@ def delete_with_http_info(resource_group_name, service_name, sid, if_match, cust # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, sid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, sid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -546,7 +526,6 @@ def delete_async(resource_group_name, service_name, sid, if_match, custom_header request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -593,8 +572,8 @@ def delete_async(resource_group_name, service_name, sid, if_match, custom_header # will be added to the HTTP request. # # - def regenerate_primary_key(resource_group_name, service_name, sid, custom_headers:nil) - response = regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def regenerate_primary_key(resource_group_name, service_name, sid, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers).value! nil end @@ -610,8 +589,8 @@ def regenerate_primary_key(resource_group_name, service_name, sid, custom_header # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid, custom_headers:nil) - regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers).value! end # @@ -626,19 +605,15 @@ def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers:nil) + def regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -684,8 +659,8 @@ def regenerate_primary_key_async(resource_group_name, service_name, sid, custom_ # will be added to the HTTP request. # # - def regenerate_secondary_key(resource_group_name, service_name, sid, custom_headers:nil) - response = regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def regenerate_secondary_key(resource_group_name, service_name, sid, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers).value! nil end @@ -701,8 +676,8 @@ def regenerate_secondary_key(resource_group_name, service_name, sid, custom_head # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_secondary_key_with_http_info(resource_group_name, service_name, sid, custom_headers:nil) - regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers).value! end # @@ -717,19 +692,15 @@ def regenerate_secondary_key_with_http_info(resource_group_name, service_name, s # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers:nil) + def regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -774,8 +745,8 @@ def regenerate_secondary_key_async(resource_group_name, service_name, sid, custo # # @return [SubscriptionCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -789,8 +760,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -803,12 +774,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -880,12 +850,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [SubscriptionCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_access.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_access.rb index eef699977b..8e41763b65 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_access.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_access.rb @@ -31,8 +31,8 @@ def initialize(client) # # @return [AccessInformationContract] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -46,8 +46,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -60,18 +60,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -129,8 +125,8 @@ def get_async(resource_group_name, service_name, custom_headers:nil) # will be added to the HTTP request. # # - def update(resource_group_name, service_name, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! nil end @@ -148,8 +144,8 @@ def update(resource_group_name, service_name, parameters, if_match, custom_heade # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! end # @@ -166,12 +162,9 @@ def update_with_http_info(resource_group_name, service_name, parameters, if_matc # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -179,13 +172,14 @@ def update_async(resource_group_name, service_name, parameters, if_match, custom request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::AccessInformationUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -231,8 +225,8 @@ def update_async(resource_group_name, service_name, parameters, if_match, custom # will be added to the HTTP request. # # - def regenerate_primary_key(resource_group_name, service_name, custom_headers:nil) - response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_primary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! nil end @@ -246,8 +240,8 @@ def regenerate_primary_key(resource_group_name, service_name, custom_headers:nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers:nil) - regenerate_primary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! end # @@ -260,18 +254,14 @@ def regenerate_primary_key_with_http_info(resource_group_name, service_name, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_primary_key_async(resource_group_name, service_name, custom_headers:nil) + def regenerate_primary_key_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -315,8 +305,8 @@ def regenerate_primary_key_async(resource_group_name, service_name, custom_heade # will be added to the HTTP request. # # - def regenerate_secondary_key(resource_group_name, service_name, custom_headers:nil) - response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_secondary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! nil end @@ -330,8 +320,8 @@ def regenerate_secondary_key(resource_group_name, service_name, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers:nil) - regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! end # @@ -344,18 +334,14 @@ def regenerate_secondary_key_with_http_info(resource_group_name, service_name, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:nil) + def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_access_git.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_access_git.rb index 4a76237671..3d18c89d76 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_access_git.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_access_git.rb @@ -31,8 +31,8 @@ def initialize(client) # # @return [AccessInformationContract] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -46,8 +46,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -60,18 +60,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -125,8 +121,8 @@ def get_async(resource_group_name, service_name, custom_headers:nil) # will be added to the HTTP request. # # - def regenerate_primary_key(resource_group_name, service_name, custom_headers:nil) - response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_primary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! nil end @@ -140,8 +136,8 @@ def regenerate_primary_key(resource_group_name, service_name, custom_headers:nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers:nil) - regenerate_primary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! end # @@ -154,18 +150,14 @@ def regenerate_primary_key_with_http_info(resource_group_name, service_name, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_primary_key_async(resource_group_name, service_name, custom_headers:nil) + def regenerate_primary_key_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -209,8 +201,8 @@ def regenerate_primary_key_async(resource_group_name, service_name, custom_heade # will be added to the HTTP request. # # - def regenerate_secondary_key(resource_group_name, service_name, custom_headers:nil) - response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_secondary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! nil end @@ -224,8 +216,8 @@ def regenerate_secondary_key(resource_group_name, service_name, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers:nil) - regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! end # @@ -238,18 +230,14 @@ def regenerate_secondary_key_with_http_info(resource_group_name, service_name, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:nil) + def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_configuration.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_configuration.rb index d0fcb52fd9..dd4744d4f4 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_configuration.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_configuration.rb @@ -35,8 +35,8 @@ def initialize(client) # # @return [OperationResultContract] operation results. # - def deploy(resource_group_name, service_name, parameters, custom_headers:nil) - response = deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def deploy(resource_group_name, service_name, parameters, custom_headers = nil) + response = deploy_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -51,9 +51,9 @@ def deploy(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def deploy_async(resource_group_name, service_name, parameters, custom_headers:nil) + def deploy_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -82,8 +82,8 @@ def deploy_async(resource_group_name, service_name, parameters, custom_headers:n # # @return [OperationResultContract] operation results. # - def save(resource_group_name, service_name, parameters, custom_headers:nil) - response = save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def save(resource_group_name, service_name, parameters, custom_headers = nil) + response = save_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -97,9 +97,9 @@ def save(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def save_async(resource_group_name, service_name, parameters, custom_headers:nil) + def save_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_save_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -128,8 +128,8 @@ def save_async(resource_group_name, service_name, parameters, custom_headers:nil # # @return [OperationResultContract] operation results. # - def validate(resource_group_name, service_name, parameters, custom_headers:nil) - response = validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def validate(resource_group_name, service_name, parameters, custom_headers = nil) + response = validate_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -144,9 +144,9 @@ def validate(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def validate_async(resource_group_name, service_name, parameters, custom_headers:nil) + def validate_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_validate_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -176,8 +176,8 @@ def validate_async(resource_group_name, service_name, parameters, custom_headers # # @return [OperationResultContract] operation results. # - def begin_deploy(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_deploy(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -195,8 +195,8 @@ def begin_deploy(resource_group_name, service_name, parameters, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_deploy_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_deploy_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_deploy_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -213,24 +213,22 @@ def begin_deploy_with_http_info(resource_group_name, service_name, parameters, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_deploy_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::DeployConfigurationParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -290,8 +288,8 @@ def begin_deploy_async(resource_group_name, service_name, parameters, custom_hea # # @return [OperationResultContract] operation results. # - def begin_save(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_save(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_save_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -308,8 +306,8 @@ def begin_save(resource_group_name, service_name, parameters, custom_headers:nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_save_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_save_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_save_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -325,24 +323,22 @@ def begin_save_with_http_info(resource_group_name, service_name, parameters, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_save_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_save_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::SaveConfigurationParameter.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -402,8 +398,8 @@ def begin_save_async(resource_group_name, service_name, parameters, custom_heade # # @return [OperationResultContract] operation results. # - def begin_validate(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_validate(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_validate_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -420,8 +416,8 @@ def begin_validate(resource_group_name, service_name, parameters, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_validate_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_validate_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_validate_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -437,24 +433,22 @@ def begin_validate_with_http_info(resource_group_name, service_name, parameters, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_validate_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_validate_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::DeployConfigurationParameters.mapper() request_content = @client.serialize(request_mapper, parameters) diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_configuration_sync_state.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_configuration_sync_state.rb index e72b64edde..cfbccecc0f 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_configuration_sync_state.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/tenant_configuration_sync_state.rb @@ -32,8 +32,8 @@ def initialize(client) # # @return [TenantConfigurationSyncStateContract] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -48,8 +48,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -63,18 +63,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_groups.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_groups.rb index c615e5267d..cb53e54ef7 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_groups.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_groups.rb @@ -44,8 +44,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_user(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_user_as_lazy(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_user(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_user_as_lazy(resource_group_name, service_name, uid, filter, top, skip, custom_headers) first_page.get_all_items end @@ -72,8 +72,8 @@ def list_by_user(resource_group_name, service_name, uid, filter:nil, top:nil, sk # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_user_with_http_info(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_user_async(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_user_with_http_info(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_user_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! end # @@ -99,24 +99,15 @@ def list_by_user_with_http_info(resource_group_name, service_name, uid, filter:n # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_user_async(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_user_async(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -171,8 +162,8 @@ def list_by_user_async(resource_group_name, service_name, uid, filter:nil, top:n # # @return [GroupCollection] operation results. # - def list_by_user_next(next_page_link, custom_headers:nil) - response = list_by_user_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_user_next(next_page_link, custom_headers = nil) + response = list_by_user_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -186,8 +177,8 @@ def list_by_user_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_user_next_with_http_info(next_page_link, custom_headers:nil) - list_by_user_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_user_next_with_http_info(next_page_link, custom_headers = nil) + list_by_user_next_async(next_page_link, custom_headers).value! end # @@ -200,12 +191,11 @@ def list_by_user_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_user_next_async(next_page_link, custom_headers:nil) + def list_by_user_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 @@ -272,12 +262,12 @@ def list_by_user_next_async(next_page_link, custom_headers:nil) # # @return [GroupCollection] which provide lazy access to pages of the response. # - def list_by_user_as_lazy(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_user_async(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_user_as_lazy(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_user_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_user_next_async(next_page_link, custom_headers:custom_headers) + list_by_user_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_identities.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_identities.rb index ed5bb4d719..7219e52337 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_identities.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_identities.rb @@ -33,8 +33,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_user(resource_group_name, service_name, uid, custom_headers:nil) - response = list_by_user_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def list_by_user(resource_group_name, service_name, uid, custom_headers = nil) + response = list_by_user_async(resource_group_name, service_name, uid, custom_headers).value! response.body unless response.nil? end @@ -50,8 +50,8 @@ def list_by_user(resource_group_name, service_name, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_user_with_http_info(resource_group_name, service_name, uid, custom_headers:nil) - list_by_user_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def list_by_user_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + list_by_user_async(resource_group_name, service_name, uid, custom_headers).value! end # @@ -66,22 +66,15 @@ def list_by_user_with_http_info(resource_group_name, service_name, uid, custom_h # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_user_async(resource_group_name, service_name, uid, custom_headers:nil) + def list_by_user_async(resource_group_name, service_name, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -114,13 +107,11 @@ def list_by_user_async(resource_group_name, service_name, uid, custom_headers:ni 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: 'UserIdentityContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_subscriptions.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_subscriptions.rb index 8642382b5b..2f41cb2475 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_subscriptions.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/user_subscriptions.rb @@ -50,8 +50,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_user(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_user_as_lazy(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_user(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_user_as_lazy(resource_group_name, service_name, uid, filter, top, skip, custom_headers) first_page.get_all_items end @@ -84,8 +84,8 @@ def list_by_user(resource_group_name, service_name, uid, filter:nil, top:nil, sk # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_user_with_http_info(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_user_async(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_user_with_http_info(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_user_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! end # @@ -117,24 +117,15 @@ def list_by_user_with_http_info(resource_group_name, service_name, uid, filter:n # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_user_async(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_user_async(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -189,8 +180,8 @@ def list_by_user_async(resource_group_name, service_name, uid, filter:nil, top:n # # @return [SubscriptionCollection] operation results. # - def list_by_user_next(next_page_link, custom_headers:nil) - response = list_by_user_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_user_next(next_page_link, custom_headers = nil) + response = list_by_user_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -204,8 +195,8 @@ def list_by_user_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_user_next_with_http_info(next_page_link, custom_headers:nil) - list_by_user_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_user_next_with_http_info(next_page_link, custom_headers = nil) + list_by_user_next_async(next_page_link, custom_headers).value! end # @@ -218,12 +209,11 @@ def list_by_user_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_user_next_async(next_page_link, custom_headers:nil) + def list_by_user_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 @@ -297,12 +287,12 @@ def list_by_user_next_async(next_page_link, custom_headers:nil) # @return [SubscriptionCollection] which provide lazy access to pages of the # response. # - def list_by_user_as_lazy(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_user_async(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_user_as_lazy(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_user_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_user_next_async(next_page_link, custom_headers:custom_headers) + list_by_user_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/users.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/users.rb index 8927418202..8e08aa9346 100644 --- a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/users.rb +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/users.rb @@ -50,8 +50,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -84,8 +84,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -117,20 +117,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -187,8 +181,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [UserContract] operation results. # - def get(resource_group_name, service_name, uid, custom_headers:nil) - response = get_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, uid, custom_headers = nil) + response = get_async(resource_group_name, service_name, uid, custom_headers).value! response.body unless response.nil? end @@ -204,8 +198,8 @@ def get(resource_group_name, service_name, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, uid, custom_headers:nil) - get_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + get_async(resource_group_name, service_name, uid, custom_headers).value! end # @@ -220,22 +214,15 @@ def get_with_http_info(resource_group_name, service_name, uid, custom_headers:ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, uid, custom_headers:nil) + def get_async(resource_group_name, service_name, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -292,8 +279,8 @@ def get_async(resource_group_name, service_name, uid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, uid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, uid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers).value! nil end @@ -310,8 +297,8 @@ def create_or_update(resource_group_name, service_name, uid, parameters, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers).value! end # @@ -327,28 +314,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, uid, para # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::UserCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -401,8 +383,8 @@ def create_or_update_async(resource_group_name, service_name, uid, parameters, c # # @return [ErrorBodyContract] operation results. # - def update(resource_group_name, service_name, uid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers).value! response.body unless response.nil? end @@ -422,8 +404,8 @@ def update(resource_group_name, service_name, uid, parameters, if_match, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, uid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers).value! end # @@ -442,16 +424,10 @@ def update_with_http_info(resource_group_name, service_name, uid, parameters, if # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -459,13 +435,14 @@ def update_async(resource_group_name, service_name, uid, parameters, if_match, c request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_07_07::Models::UserUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -529,8 +506,8 @@ def update_async(resource_group_name, service_name, uid, parameters, if_match, c # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, uid, if_match, delete_subscriptions:nil, custom_headers:nil) - response = delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions:delete_subscriptions, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, custom_headers = nil) + response = delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions, custom_headers).value! response.body unless response.nil? end @@ -551,8 +528,8 @@ def delete(resource_group_name, service_name, uid, if_match, delete_subscription # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, uid, if_match, delete_subscriptions:nil, custom_headers:nil) - delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions:delete_subscriptions, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, custom_headers = nil) + delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions, custom_headers).value! end # @@ -572,23 +549,16 @@ def delete_with_http_info(resource_group_name, service_name, uid, if_match, dele # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions:nil, custom_headers:nil) + def delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -647,8 +617,8 @@ def delete_async(resource_group_name, service_name, uid, if_match, delete_subscr # # @return [GenerateSsoUrlResult] operation results. # - def generate_sso_url(resource_group_name, service_name, uid, custom_headers:nil) - response = generate_sso_url_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def generate_sso_url(resource_group_name, service_name, uid, custom_headers = nil) + response = generate_sso_url_async(resource_group_name, service_name, uid, custom_headers).value! response.body unless response.nil? end @@ -665,8 +635,8 @@ def generate_sso_url(resource_group_name, service_name, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def generate_sso_url_with_http_info(resource_group_name, service_name, uid, custom_headers:nil) - generate_sso_url_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def generate_sso_url_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + generate_sso_url_async(resource_group_name, service_name, uid, custom_headers).value! end # @@ -682,22 +652,15 @@ def generate_sso_url_with_http_info(resource_group_name, service_name, uid, cust # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def generate_sso_url_async(resource_group_name, service_name, uid, custom_headers:nil) + def generate_sso_url_async(resource_group_name, service_name, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -752,8 +715,8 @@ def generate_sso_url_async(resource_group_name, service_name, uid, custom_header # # @return [UserCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -767,8 +730,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -781,12 +744,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -859,12 +821,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # # @return [UserCollection] which provide lazy access to pages of the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/version.rb b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/version.rb new file mode 100644 index 0000000000..bc156d6133 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/version.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2016_07_07 + VERSION = '0.17.0' +end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_export.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_export.rb index dec2b9c718..bf58a6669f 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_export.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_export.rb @@ -33,8 +33,8 @@ def initialize(client) # # @return [ApiExportResult] operation results. # - def get(resource_group_name, service_name, api_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, api_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, custom_headers).value! response.body unless response.nil? end @@ -50,8 +50,8 @@ def get(resource_group_name, service_name, api_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, api_id, custom_headers:nil) - get_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, custom_headers).value! end # @@ -66,22 +66,15 @@ def get_with_http_info(resource_group_name, service_name, api_id, custom_headers # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, api_id, custom_headers:nil) + def get_async(resource_group_name, service_name, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb index 8cbd065d77..743a4c5b8e 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb @@ -258,9 +258,6 @@ def make_request_async(method, path, options = {}) fail ArgumentError, 'path is nil' if path.nil? request_url = options[:base_url] || @base_url - if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) - @request_headers['Content-Type'] = options[:headers]['Content-Type'] - end request_headers = @request_headers request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? @@ -277,7 +274,9 @@ def make_request_async(method, path, options = {}) # def add_telemetry sdk_information = 'azure_mgmt_api_management' - sdk_information = "#{sdk_information}/0.17.0" + if defined? Azure::ApiManagement::Mgmt::V2016_10_10::VERSION + sdk_information = "#{sdk_information}/#{Azure::ApiManagement::Mgmt::V2016_10_10::VERSION}" + end add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_operations.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_operations.rb index 06c392510d..c57dbf42b6 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_operations.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_operations.rb @@ -30,8 +30,8 @@ def initialize(client) # # @return [Array] operation results. # - def list(custom_headers:nil) - first_page = list_as_lazy(custom_headers:custom_headers) + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) first_page.get_all_items end @@ -44,8 +44,8 @@ def list(custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_with_http_info(custom_headers:nil) - list_async(custom_headers:custom_headers).value! + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! end # @@ -57,12 +57,11 @@ def list_with_http_info(custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_async(custom_headers:nil) + def list_async(custom_headers = 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 @@ -117,8 +116,8 @@ def list_async(custom_headers:nil) # # @return [OperationListResult] operation results. # - def list_next(next_page_link, custom_headers:nil) - response = list_next_async(next_page_link, custom_headers:custom_headers).value! + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -133,8 +132,8 @@ def list_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_next_with_http_info(next_page_link, custom_headers:nil) - list_next_async(next_page_link, custom_headers:custom_headers).value! + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! end # @@ -148,12 +147,11 @@ def list_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_next_async(next_page_link, custom_headers:nil) + 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 @@ -207,12 +205,12 @@ def list_next_async(next_page_link, custom_headers:nil) # @return [OperationListResult] which provide lazy access to pages of the # response. # - def list_as_lazy(custom_headers:nil) - response = list_async(custom_headers:custom_headers).value! + def list_as_lazy(custom_headers = nil) + response = list_async(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) + list_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb index 613f1d33c9..bdc5c5a077 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb @@ -36,8 +36,8 @@ def initialize(client) # # @return [ApiManagementServiceResource] operation results. # - def manage_deployments(resource_group_name, service_name, parameters, custom_headers:nil) - response = manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def manage_deployments(resource_group_name, service_name, parameters, custom_headers = nil) + response = manage_deployments_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -52,9 +52,9 @@ def manage_deployments(resource_group_name, service_name, parameters, custom_hea # @return [Concurrent::Promise] promise which provides async access to http # response. # - def manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:nil) + def manage_deployments_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -84,8 +84,8 @@ def manage_deployments_async(resource_group_name, service_name, parameters, cust # # @return [ApiManagementServiceResource] operation results. # - def restore(resource_group_name, service_name, parameters, custom_headers:nil) - response = restore_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def restore(resource_group_name, service_name, parameters, custom_headers = nil) + response = restore_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -100,9 +100,9 @@ def restore(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def restore_async(resource_group_name, service_name, parameters, custom_headers:nil) + def restore_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_restore_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_restore_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -132,8 +132,8 @@ def restore_async(resource_group_name, service_name, parameters, custom_headers: # # @return [ApiManagementServiceResource] operation results. # - def backup(resource_group_name, service_name, parameters, custom_headers:nil) - response = backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def backup(resource_group_name, service_name, parameters, custom_headers = nil) + response = backup_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -148,9 +148,9 @@ def backup(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def backup_async(resource_group_name, service_name, parameters, custom_headers:nil) + def backup_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_backup_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -179,8 +179,8 @@ def backup_async(resource_group_name, service_name, parameters, custom_headers:n # # @return [ApiManagementServiceResource] operation results. # - def create_or_update(resource_group_name, service_name, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -197,8 +197,8 @@ def create_or_update(resource_group_name, service_name, parameters, custom_heade # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -214,24 +214,22 @@ def create_or_update_with_http_info(resource_group_name, service_name, parameter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiManagementServiceResource.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -300,8 +298,8 @@ def create_or_update_async(resource_group_name, service_name, parameters, custom # # @return [ApiManagementServiceResource] operation results. # - def update(resource_group_name, service_name, parameters, custom_headers:nil) - response = update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -316,9 +314,9 @@ def update(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def update_async(resource_group_name, service_name, parameters, custom_headers:nil) + def update_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_update_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -344,8 +342,8 @@ def update_async(resource_group_name, service_name, parameters, custom_headers:n # # @return [ApiManagementServiceResource] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -359,8 +357,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -373,18 +371,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -438,8 +432,8 @@ def get_async(resource_group_name, service_name, custom_headers:nil) # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, custom_headers:nil) - response = delete_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, custom_headers = nil) + response = delete_async(resource_group_name, service_name, custom_headers).value! nil end @@ -453,8 +447,8 @@ def delete(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, custom_headers:nil) - delete_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, custom_headers = nil) + delete_async(resource_group_name, service_name, custom_headers).value! end # @@ -467,18 +461,14 @@ def delete_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, custom_headers:nil) + def delete_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -522,8 +512,8 @@ def delete_async(resource_group_name, service_name, custom_headers:nil) # # @return [Array] operation results. # - 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) + def list_by_resource_group(resource_group_name, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers) first_page.get_all_items end @@ -536,8 +526,8 @@ def list_by_resource_group(resource_group_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - 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! + def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) + list_by_resource_group_async(resource_group_name, custom_headers).value! end # @@ -549,14 +539,13 @@ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_resource_group_async(resource_group_name, custom_headers:nil) + 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, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -609,8 +598,8 @@ def list_by_resource_group_async(resource_group_name, custom_headers:nil) # # @return [Array] operation results. # - def list(custom_headers:nil) - first_page = list_as_lazy(custom_headers:custom_headers) + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) first_page.get_all_items end @@ -622,8 +611,8 @@ def list(custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_with_http_info(custom_headers:nil) - list_async(custom_headers:custom_headers).value! + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! end # @@ -634,13 +623,12 @@ def list_with_http_info(custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_async(custom_headers:nil) + def list_async(custom_headers = nil) fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -696,8 +684,8 @@ def list_async(custom_headers:nil) # # @return [ApiManagementServiceGetSsoTokenResult] operation results. # - def get_sso_token(resource_group_name, service_name, custom_headers:nil) - response = get_sso_token_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_sso_token(resource_group_name, service_name, custom_headers = nil) + response = get_sso_token_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -712,8 +700,8 @@ def get_sso_token(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_sso_token_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_sso_token_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_sso_token_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_sso_token_async(resource_group_name, service_name, custom_headers).value! end # @@ -727,18 +715,14 @@ def get_sso_token_with_http_info(resource_group_name, service_name, custom_heade # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_sso_token_async(resource_group_name, service_name, custom_headers:nil) + def get_sso_token_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -793,8 +777,8 @@ def get_sso_token_async(resource_group_name, service_name, custom_headers:nil) # # @return [ApiManagementServiceNameAvailabilityResult] operation results. # - def check_name_availability(parameters, custom_headers:nil) - response = check_name_availability_async(parameters, custom_headers:custom_headers).value! + def check_name_availability(parameters, custom_headers = nil) + response = check_name_availability_async(parameters, custom_headers).value! response.body unless response.nil? end @@ -808,8 +792,8 @@ def check_name_availability(parameters, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def check_name_availability_with_http_info(parameters, custom_headers:nil) - check_name_availability_async(parameters, custom_headers:custom_headers).value! + def check_name_availability_with_http_info(parameters, custom_headers = nil) + check_name_availability_async(parameters, custom_headers).value! end # @@ -822,19 +806,20 @@ def check_name_availability_with_http_info(parameters, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def check_name_availability_async(parameters, custom_headers:nil) + def check_name_availability_async(parameters, custom_headers = nil) fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiManagementServiceCheckNameAvailabilityParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -894,8 +879,8 @@ def check_name_availability_async(parameters, custom_headers:nil) # # @return [CertificateInformation] operation results. # - def upload_certificate(resource_group_name, service_name, parameters, custom_headers:nil) - response = upload_certificate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def upload_certificate(resource_group_name, service_name, parameters, custom_headers = nil) + response = upload_certificate_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -912,8 +897,8 @@ def upload_certificate(resource_group_name, service_name, parameters, custom_hea # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def upload_certificate_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - upload_certificate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def upload_certificate_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + upload_certificate_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -929,24 +914,22 @@ def upload_certificate_with_http_info(resource_group_name, service_name, paramet # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def upload_certificate_async(resource_group_name, service_name, parameters, custom_headers:nil) + def upload_certificate_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiManagementServiceUploadCertificateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1007,8 +990,8 @@ def upload_certificate_async(resource_group_name, service_name, parameters, cust # # @return [ApiManagementServiceResource] operation results. # - def update_hostname(resource_group_name, service_name, parameters, custom_headers:nil) - response = update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def update_hostname(resource_group_name, service_name, parameters, custom_headers = nil) + response = update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1023,9 +1006,9 @@ def update_hostname(resource_group_name, service_name, parameters, custom_header # @return [Concurrent::Promise] promise which provides async access to http # response. # - def update_hostname_async(resource_group_name, service_name, parameters, custom_headers:nil) + def update_hostname_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -1052,8 +1035,8 @@ def update_hostname_async(resource_group_name, service_name, parameters, custom_ # # @return [ApiManagementServiceResource] operation results. # - def apply_network_configuration_updates(resource_group_name, service_name, custom_headers:nil) - response = apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def apply_network_configuration_updates(resource_group_name, service_name, custom_headers = nil) + response = apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -1066,9 +1049,9 @@ def apply_network_configuration_updates(resource_group_name, service_name, custo # @return [Concurrent::Promise] promise which provides async access to http # response. # - def apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers:nil) + def apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers = nil) # Send request - promise = begin_apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers:custom_headers) + promise = begin_apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -1099,8 +1082,8 @@ def apply_network_configuration_updates_async(resource_group_name, service_name, # # @return [ApiManagementServiceResource] operation results. # - def begin_manage_deployments(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_manage_deployments(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1119,8 +1102,8 @@ def begin_manage_deployments(resource_group_name, service_name, parameters, cust # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_manage_deployments_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_manage_deployments_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1138,24 +1121,22 @@ def begin_manage_deployments_with_http_info(resource_group_name, service_name, p # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_manage_deployments_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiManagementServiceManageDeploymentsParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1226,8 +1207,8 @@ def begin_manage_deployments_async(resource_group_name, service_name, parameters # # @return [ApiManagementServiceResource] operation results. # - def begin_restore(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_restore_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_restore(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_restore_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1245,8 +1226,8 @@ def begin_restore(resource_group_name, service_name, parameters, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_restore_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_restore_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_restore_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_restore_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1263,24 +1244,22 @@ def begin_restore_with_http_info(resource_group_name, service_name, parameters, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_restore_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_restore_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiManagementServiceBackupRestoreParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1341,8 +1320,8 @@ def begin_restore_async(resource_group_name, service_name, parameters, custom_he # # @return [ApiManagementServiceResource] operation results. # - def begin_backup(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_backup(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_backup_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1360,8 +1339,8 @@ def begin_backup(resource_group_name, service_name, parameters, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_backup_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_backup_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_backup_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1378,24 +1357,22 @@ def begin_backup_with_http_info(resource_group_name, service_name, parameters, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_backup_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_backup_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiManagementServiceBackupRestoreParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1454,8 +1431,8 @@ def begin_backup_async(resource_group_name, service_name, parameters, custom_hea # # @return [ApiManagementServiceResource] operation results. # - def begin_update(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_update_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1471,8 +1448,8 @@ def begin_update(resource_group_name, service_name, parameters, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_update_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_update_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1487,24 +1464,22 @@ def begin_update_with_http_info(resource_group_name, service_name, parameters, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_update_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_update_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiManagementServiceUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1565,8 +1540,8 @@ def begin_update_async(resource_group_name, service_name, parameters, custom_hea # # @return [ApiManagementServiceResource] operation results. # - def begin_update_hostname(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_update_hostname(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -1584,8 +1559,8 @@ def begin_update_hostname(resource_group_name, service_name, parameters, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_update_hostname_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_update_hostname_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -1602,24 +1577,22 @@ def begin_update_hostname_with_http_info(resource_group_name, service_name, para # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiManagementServiceUpdateHostnameParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -1687,8 +1660,8 @@ def begin_update_hostname_async(resource_group_name, service_name, parameters, c # # @return [ApiManagementServiceResource] operation results. # - def begin_apply_network_configuration_updates(resource_group_name, service_name, custom_headers:nil) - response = begin_apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def begin_apply_network_configuration_updates(resource_group_name, service_name, custom_headers = nil) + response = begin_apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -1703,8 +1676,8 @@ def begin_apply_network_configuration_updates(resource_group_name, service_name, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_apply_network_configuration_updates_with_http_info(resource_group_name, service_name, custom_headers:nil) - begin_apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def begin_apply_network_configuration_updates_with_http_info(resource_group_name, service_name, custom_headers = nil) + begin_apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers).value! end # @@ -1718,18 +1691,14 @@ def begin_apply_network_configuration_updates_with_http_info(resource_group_name # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers:nil) + def begin_apply_network_configuration_updates_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -1784,8 +1753,8 @@ def begin_apply_network_configuration_updates_async(resource_group_name, service # # @return [ApiManagementServiceListResult] operation results. # - 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! + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -1799,8 +1768,8 @@ def list_by_resource_group_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - 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! + 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).value! end # @@ -1813,12 +1782,11 @@ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_resource_group_next_async(next_page_link, custom_headers:nil) + 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 @@ -1872,8 +1840,8 @@ def list_by_resource_group_next_async(next_page_link, custom_headers:nil) # # @return [ApiManagementServiceListResult] operation results. # - def list_next(next_page_link, custom_headers:nil) - response = list_next_async(next_page_link, custom_headers:custom_headers).value! + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -1887,8 +1855,8 @@ def list_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_next_with_http_info(next_page_link, custom_headers:nil) - list_next_async(next_page_link, custom_headers:custom_headers).value! + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! end # @@ -1901,12 +1869,11 @@ def list_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_next_async(next_page_link, custom_headers:nil) + 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 @@ -1960,12 +1927,12 @@ def list_next_async(next_page_link, custom_headers:nil) # @return [ApiManagementServiceListResult] which provide lazy access to pages # of the response. # - 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! + def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, 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) + list_by_resource_group_next_async(next_page_link, custom_headers) end page end @@ -1980,12 +1947,12 @@ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil) # @return [ApiManagementServiceListResult] which provide lazy access to pages # of the response. # - def list_as_lazy(custom_headers:nil) - response = list_async(custom_headers:custom_headers).value! + def list_as_lazy(custom_headers = nil) + response = list_async(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) + list_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_operations.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_operations.rb index d1faa05c57..47ad4901d6 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_operations.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_operations.rb @@ -42,8 +42,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_apis(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_apis(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -68,8 +68,8 @@ def list_by_apis(resource_group_name, service_name, api_id, filter:nil, top:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_apis_with_http_info(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_apis_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_apis_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_apis_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! end # @@ -93,24 +93,15 @@ def list_by_apis_with_http_info(resource_group_name, service_name, api_id, filte # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_apis_async(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_apis_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -169,8 +160,8 @@ def list_by_apis_async(resource_group_name, service_name, api_id, filter:nil, to # # @return [OperationContract] operation results. # - def get(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! response.body unless response.nil? end @@ -188,8 +179,8 @@ def get(resource_group_name, service_name, api_id, operation_id, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) - get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! end # @@ -206,26 +197,16 @@ def get_with_http_info(resource_group_name, service_name, api_id, operation_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) + def get_async(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -284,8 +265,8 @@ def get_async(resource_group_name, service_name, api_id, operation_id, custom_he # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers).value! nil end @@ -304,8 +285,8 @@ def create_or_update(resource_group_name, service_name, api_id, operation_id, pa # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers).value! end # @@ -323,32 +304,24 @@ def create_or_update_with_http_info(resource_group_name, service_name, api_id, o # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::OperationContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -402,8 +375,8 @@ def create_or_update_async(resource_group_name, service_name, api_id, operation_ # will be added to the HTTP request. # # - def update(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! nil end @@ -425,8 +398,8 @@ def update(resource_group_name, service_name, api_id, operation_id, parameters, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! end # @@ -447,20 +420,11 @@ def update_with_http_info(resource_group_name, service_name, api_id, operation_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -468,13 +432,14 @@ def update_async(resource_group_name, service_name, api_id, operation_id, parame request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::OperationUpdateContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -527,8 +492,8 @@ def update_async(resource_group_name, service_name, api_id, operation_id, parame # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! nil end @@ -549,8 +514,8 @@ def delete(resource_group_name, service_name, api_id, operation_id, if_match, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! end # @@ -570,27 +535,17 @@ def delete_with_http_info(resource_group_name, service_name, api_id, operation_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -636,8 +591,8 @@ def delete_async(resource_group_name, service_name, api_id, operation_id, if_mat # # @return [OperationCollection] operation results. # - def list_by_apis_next(next_page_link, custom_headers:nil) - response = list_by_apis_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_apis_next(next_page_link, custom_headers = nil) + response = list_by_apis_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -651,8 +606,8 @@ def list_by_apis_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_apis_next_with_http_info(next_page_link, custom_headers:nil) - list_by_apis_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_apis_next_with_http_info(next_page_link, custom_headers = nil) + list_by_apis_next_async(next_page_link, custom_headers).value! end # @@ -665,12 +620,11 @@ def list_by_apis_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_apis_next_async(next_page_link, custom_headers:nil) + def list_by_apis_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 @@ -736,12 +690,12 @@ def list_by_apis_next_async(next_page_link, custom_headers:nil) # @return [OperationCollection] which provide lazy access to pages of the # response. # - def list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_apis_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_apis_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_apis_next_async(next_page_link, custom_headers:custom_headers) + list_by_apis_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_operations_policy.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_operations_policy.rb index a056847ec4..e5a6c87938 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_operations_policy.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_operations_policy.rb @@ -35,8 +35,8 @@ def initialize(client) # # @return [NOT_IMPLEMENTED] operation results. # - def get(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! response.body unless response.nil? end @@ -54,8 +54,8 @@ def get(resource_group_name, service_name, api_id, operation_id, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) - get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! end # @@ -72,26 +72,16 @@ def get_with_http_info(resource_group_name, service_name, api_id, operation_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, api_id, operation_id, custom_headers:nil) + def get_async(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -124,7 +114,6 @@ def get_async(resource_group_name, service_name, api_id, operation_id, custom_he 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: { @@ -160,8 +149,8 @@ def get_async(resource_group_name, service_name, api_id, operation_id, custom_he # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! nil end @@ -183,8 +172,8 @@ def create_or_update(resource_group_name, service_name, api_id, operation_id, pa # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! end # @@ -205,20 +194,11 @@ def create_or_update_with_http_info(resource_group_name, service_name, api_id, o # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -226,16 +206,16 @@ def create_or_update_async(resource_group_name, service_name, api_id, operation_ request_headers = {} - request_headers['Content-Type'] = 'application/vnd.ms-azure-apim.policy+xml' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/vnd.ms-azure-apim.policy+xml' + # Serialize Request request_mapper = { - client_side_validation: true, required: true, serialized_name: 'parameters', type: { @@ -243,6 +223,7 @@ def create_or_update_async(resource_group_name, service_name, api_id, operation_ } } request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policy' @@ -291,8 +272,8 @@ def create_or_update_async(resource_group_name, service_name, api_id, operation_ # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! nil end @@ -313,8 +294,8 @@ def delete(resource_group_name, service_name, api_id, operation_id, if_match, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! end # @@ -334,27 +315,17 @@ def delete_with_http_info(resource_group_name, service_name, api_id, operation_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'operation_id is nil' if operation_id.nil? - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MaxLength': '256'" if !operation_id.nil? && operation_id.length > 256 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'MinLength': '1'" if !operation_id.nil? && operation_id.length < 1 - fail ArgumentError, "'operation_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !operation_id.nil? && operation_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_policy.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_policy.rb index fc5de512dc..b7c903c3a6 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_policy.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_policy.rb @@ -33,8 +33,8 @@ def initialize(client) # # @return [NOT_IMPLEMENTED] operation results. # - def get(resource_group_name, service_name, api_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, api_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, custom_headers).value! response.body unless response.nil? end @@ -50,8 +50,8 @@ def get(resource_group_name, service_name, api_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, api_id, custom_headers:nil) - get_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, custom_headers).value! end # @@ -66,22 +66,15 @@ def get_with_http_info(resource_group_name, service_name, api_id, custom_headers # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, api_id, custom_headers:nil) + def get_async(resource_group_name, service_name, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -114,7 +107,6 @@ def get_async(resource_group_name, service_name, api_id, custom_headers:nil) 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: { @@ -148,8 +140,8 @@ def get_async(resource_group_name, service_name, api_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! nil end @@ -169,8 +161,8 @@ def create_or_update(resource_group_name, service_name, api_id, parameters, if_m # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! end # @@ -189,16 +181,10 @@ def create_or_update_with_http_info(resource_group_name, service_name, api_id, p # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -206,16 +192,16 @@ def create_or_update_async(resource_group_name, service_name, api_id, parameters request_headers = {} - request_headers['Content-Type'] = 'application/vnd.ms-azure-apim.policy+xml' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/vnd.ms-azure-apim.policy+xml' + # Serialize Request request_mapper = { - client_side_validation: true, required: true, serialized_name: 'parameters', type: { @@ -223,6 +209,7 @@ def create_or_update_async(resource_group_name, service_name, api_id, parameters } } request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policy' @@ -269,8 +256,8 @@ def create_or_update_async(resource_group_name, service_name, api_id, parameters # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, api_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, if_match, custom_headers).value! nil end @@ -289,8 +276,8 @@ def delete(resource_group_name, service_name, api_id, if_match, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, api_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, if_match, custom_headers).value! end # @@ -308,23 +295,16 @@ def delete_with_http_info(resource_group_name, service_name, api_id, if_match, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, api_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_products.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_products.rb index 04b07cc3d6..78b43018e2 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_products.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_products.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_apis(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_apis(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_apis(resource_group_name, service_name, api_id, filter:nil, top:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_apis_with_http_info(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_apis_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_apis_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_apis_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! end # @@ -87,24 +87,15 @@ def list_by_apis_with_http_info(resource_group_name, service_name, api_id, filte # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_apis_async(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_apis_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -159,8 +150,8 @@ def list_by_apis_async(resource_group_name, service_name, api_id, filter:nil, to # # @return [ProductCollection] operation results. # - def list_by_apis_next(next_page_link, custom_headers:nil) - response = list_by_apis_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_apis_next(next_page_link, custom_headers = nil) + response = list_by_apis_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -174,8 +165,8 @@ def list_by_apis_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_apis_next_with_http_info(next_page_link, custom_headers:nil) - list_by_apis_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_apis_next_with_http_info(next_page_link, custom_headers = nil) + list_by_apis_next_async(next_page_link, custom_headers).value! end # @@ -188,12 +179,11 @@ def list_by_apis_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_apis_next_async(next_page_link, custom_headers:nil) + def list_by_apis_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 @@ -257,12 +247,12 @@ def list_by_apis_next_async(next_page_link, custom_headers:nil) # @return [ProductCollection] which provide lazy access to pages of the # response. # - def list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_apis_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_apis_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_apis_next_async(next_page_link, custom_headers:custom_headers) + list_by_apis_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/apis.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/apis.rb index 6dac50e136..495e729b30 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/apis.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/apis.rb @@ -41,8 +41,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -66,8 +66,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -90,20 +90,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -160,8 +154,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [ApiContract] operation results. # - def get(resource_group_name, service_name, api_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, api_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, custom_headers).value! response.body unless response.nil? end @@ -177,8 +171,8 @@ def get(resource_group_name, service_name, api_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, api_id, custom_headers:nil) - get_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, custom_headers).value! end # @@ -193,22 +187,15 @@ def get_with_http_info(resource_group_name, service_name, api_id, custom_headers # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, api_id, custom_headers:nil) + def get_async(resource_group_name, service_name, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -269,8 +256,8 @@ def get_async(resource_group_name, service_name, api_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, api_id, parameters, if_match:nil, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match:if_match, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! nil end @@ -291,8 +278,8 @@ def create_or_update(resource_group_name, service_name, api_id, parameters, if_m # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match:nil, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match:if_match, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! end # @@ -312,29 +299,24 @@ def create_or_update_with_http_info(resource_group_name, service_name, api_id, p # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match:nil, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -386,8 +368,8 @@ def create_or_update_async(resource_group_name, service_name, api_id, parameters # will be added to the HTTP request. # # - def update(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! nil end @@ -407,8 +389,8 @@ def update(resource_group_name, service_name, api_id, parameters, if_match, cust # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! end # @@ -427,16 +409,10 @@ def update_with_http_info(resource_group_name, service_name, api_id, parameters, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -444,13 +420,14 @@ def update_async(resource_group_name, service_name, api_id, parameters, if_match request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ApiUpdateContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -501,8 +478,8 @@ def update_async(resource_group_name, service_name, api_id, parameters, if_match # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, api_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, if_match, custom_headers).value! nil end @@ -521,8 +498,8 @@ def delete(resource_group_name, service_name, api_id, if_match, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, api_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, if_match, custom_headers).value! end # @@ -540,23 +517,16 @@ def delete_with_http_info(resource_group_name, service_name, api_id, if_match, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, api_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, api_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -602,8 +572,8 @@ def delete_async(resource_group_name, service_name, api_id, if_match, custom_hea # # @return [ApiCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -617,8 +587,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -631,12 +601,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -700,12 +669,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # # @return [ApiCollection] which provide lazy access to pages of the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/authorization_servers.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/authorization_servers.rb index 2de59429c1..72e857efee 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/authorization_servers.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/authorization_servers.rb @@ -41,8 +41,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -66,8 +66,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -90,20 +90,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -159,8 +153,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [OAuth2AuthorizationServerContract] operation results. # - def get(resource_group_name, service_name, authsid, custom_headers:nil) - response = get_async(resource_group_name, service_name, authsid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, authsid, custom_headers = nil) + response = get_async(resource_group_name, service_name, authsid, custom_headers).value! response.body unless response.nil? end @@ -175,8 +169,8 @@ def get(resource_group_name, service_name, authsid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, authsid, custom_headers:nil) - get_async(resource_group_name, service_name, authsid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, authsid, custom_headers = nil) + get_async(resource_group_name, service_name, authsid, custom_headers).value! end # @@ -190,21 +184,15 @@ def get_with_http_info(resource_group_name, service_name, authsid, custom_header # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, authsid, custom_headers:nil) + def get_async(resource_group_name, service_name, authsid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'authsid is nil' if authsid.nil? - fail ArgumentError, "'authsid' should satisfy the constraint - 'MaxLength': '256'" if !authsid.nil? && authsid.length > 256 - fail ArgumentError, "'authsid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !authsid.nil? && authsid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -261,8 +249,8 @@ def get_async(resource_group_name, service_name, authsid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, authsid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, authsid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers).value! nil end @@ -279,8 +267,8 @@ def create_or_update(resource_group_name, service_name, authsid, parameters, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, authsid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, authsid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers).value! end # @@ -296,27 +284,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, authsid, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, authsid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'authsid is nil' if authsid.nil? - fail ArgumentError, "'authsid' should satisfy the constraint - 'MaxLength': '256'" if !authsid.nil? && authsid.length > 256 - fail ArgumentError, "'authsid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !authsid.nil? && authsid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::OAuth2AuthorizationServerContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -368,8 +352,8 @@ def create_or_update_async(resource_group_name, service_name, authsid, parameter # will be added to the HTTP request. # # - def update(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers).value! nil end @@ -389,8 +373,8 @@ def update(resource_group_name, service_name, authsid, parameters, if_match, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers).value! end # @@ -409,15 +393,10 @@ def update_with_http_info(resource_group_name, service_name, authsid, parameters # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'authsid is nil' if authsid.nil? - fail ArgumentError, "'authsid' should satisfy the constraint - 'MaxLength': '256'" if !authsid.nil? && authsid.length > 256 - fail ArgumentError, "'authsid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !authsid.nil? && authsid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -425,13 +404,14 @@ def update_async(resource_group_name, service_name, authsid, parameters, if_matc request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::OAuth2AuthorizationServerUpdateContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -481,8 +461,8 @@ def update_async(resource_group_name, service_name, authsid, parameters, if_matc # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, authsid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, authsid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, authsid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, authsid, if_match, custom_headers).value! nil end @@ -500,8 +480,8 @@ def delete(resource_group_name, service_name, authsid, if_match, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, authsid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, authsid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, authsid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, authsid, if_match, custom_headers).value! end # @@ -518,22 +498,16 @@ def delete_with_http_info(resource_group_name, service_name, authsid, if_match, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, authsid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, authsid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'authsid is nil' if authsid.nil? - fail ArgumentError, "'authsid' should satisfy the constraint - 'MaxLength': '256'" if !authsid.nil? && authsid.length > 256 - fail ArgumentError, "'authsid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !authsid.nil? && authsid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -580,8 +554,8 @@ def delete_async(resource_group_name, service_name, authsid, if_match, custom_he # # @return [AuthorizationServerCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -596,8 +570,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -611,12 +585,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -681,12 +654,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [AuthorizationServerCollection] which provide lazy access to pages of # the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/backends.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/backends.rb index 6ca4fda2c3..467f053062 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/backends.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/backends.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -87,20 +87,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -157,8 +151,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [BackendResponse] operation results. # - def get(resource_group_name, service_name, backendid, custom_headers:nil) - response = get_async(resource_group_name, service_name, backendid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, backendid, custom_headers = nil) + response = get_async(resource_group_name, service_name, backendid, custom_headers).value! response.body unless response.nil? end @@ -174,8 +168,8 @@ def get(resource_group_name, service_name, backendid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, backendid, custom_headers:nil) - get_async(resource_group_name, service_name, backendid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, backendid, custom_headers = nil) + get_async(resource_group_name, service_name, backendid, custom_headers).value! end # @@ -190,22 +184,15 @@ def get_with_http_info(resource_group_name, service_name, backendid, custom_head # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, backendid, custom_headers:nil) + def get_async(resource_group_name, service_name, backendid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'backendid is nil' if backendid.nil? - fail ArgumentError, "'backendid' should satisfy the constraint - 'MaxLength': '255'" if !backendid.nil? && backendid.length > 255 - fail ArgumentError, "'backendid' should satisfy the constraint - 'MinLength': '1'" if !backendid.nil? && backendid.length < 1 - fail ArgumentError, "'backendid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !backendid.nil? && backendid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -262,8 +249,8 @@ def get_async(resource_group_name, service_name, backendid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, backendid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, backendid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers).value! nil end @@ -280,8 +267,8 @@ def create_or_update(resource_group_name, service_name, backendid, parameters, c # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, backendid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, backendid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers).value! end # @@ -297,28 +284,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, backendid # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, backendid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'backendid is nil' if backendid.nil? - fail ArgumentError, "'backendid' should satisfy the constraint - 'MaxLength': '255'" if !backendid.nil? && backendid.length > 255 - fail ArgumentError, "'backendid' should satisfy the constraint - 'MinLength': '1'" if !backendid.nil? && backendid.length < 1 - fail ArgumentError, "'backendid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !backendid.nil? && backendid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::BackendContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -370,8 +352,8 @@ def create_or_update_async(resource_group_name, service_name, backendid, paramet # will be added to the HTTP request. # # - def update(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers).value! nil end @@ -391,8 +373,8 @@ def update(resource_group_name, service_name, backendid, parameters, if_match, c # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers).value! end # @@ -411,16 +393,10 @@ def update_with_http_info(resource_group_name, service_name, backendid, paramete # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'backendid is nil' if backendid.nil? - fail ArgumentError, "'backendid' should satisfy the constraint - 'MaxLength': '255'" if !backendid.nil? && backendid.length > 255 - fail ArgumentError, "'backendid' should satisfy the constraint - 'MinLength': '1'" if !backendid.nil? && backendid.length < 1 - fail ArgumentError, "'backendid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !backendid.nil? && backendid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -428,13 +404,14 @@ def update_async(resource_group_name, service_name, backendid, parameters, if_ma request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::BackendUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -485,8 +462,8 @@ def update_async(resource_group_name, service_name, backendid, parameters, if_ma # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, backendid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, backendid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, backendid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, backendid, if_match, custom_headers).value! nil end @@ -505,8 +482,8 @@ def delete(resource_group_name, service_name, backendid, if_match, custom_header # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, backendid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, backendid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, backendid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, backendid, if_match, custom_headers).value! end # @@ -524,23 +501,16 @@ def delete_with_http_info(resource_group_name, service_name, backendid, if_match # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, backendid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, backendid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'backendid is nil' if backendid.nil? - fail ArgumentError, "'backendid' should satisfy the constraint - 'MaxLength': '255'" if !backendid.nil? && backendid.length > 255 - fail ArgumentError, "'backendid' should satisfy the constraint - 'MinLength': '1'" if !backendid.nil? && backendid.length < 1 - fail ArgumentError, "'backendid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !backendid.nil? && backendid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -586,8 +556,8 @@ def delete_async(resource_group_name, service_name, backendid, if_match, custom_ # # @return [BackendCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -601,8 +571,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -615,12 +585,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -684,12 +653,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [BackendCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/certificates.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/certificates.rb index 0ecd850d7e..c7adaf32ef 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/certificates.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/certificates.rb @@ -44,8 +44,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -72,8 +72,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -99,20 +99,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -169,8 +163,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [CertificateContract] operation results. # - def get(resource_group_name, service_name, certificate_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, certificate_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, certificate_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, certificate_id, custom_headers).value! response.body unless response.nil? end @@ -186,8 +180,8 @@ def get(resource_group_name, service_name, certificate_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, certificate_id, custom_headers:nil) - get_async(resource_group_name, service_name, certificate_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, certificate_id, custom_headers = nil) + get_async(resource_group_name, service_name, certificate_id, custom_headers).value! end # @@ -202,22 +196,15 @@ def get_with_http_info(resource_group_name, service_name, certificate_id, custom # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, certificate_id, custom_headers:nil) + def get_async(resource_group_name, service_name, certificate_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'MaxLength': '256'" if !certificate_id.nil? && certificate_id.length > 256 - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'MinLength': '1'" if !certificate_id.nil? && certificate_id.length < 1 - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !certificate_id.nil? && certificate_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -278,8 +265,8 @@ def get_async(resource_group_name, service_name, certificate_id, custom_headers: # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, certificate_id, parameters, if_match:nil, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match:if_match, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match, custom_headers).value! nil end @@ -300,8 +287,8 @@ def create_or_update(resource_group_name, service_name, certificate_id, paramete # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, certificate_id, parameters, if_match:nil, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match:if_match, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match, custom_headers).value! end # @@ -321,29 +308,24 @@ def create_or_update_with_http_info(resource_group_name, service_name, certifica # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match:nil, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'MaxLength': '256'" if !certificate_id.nil? && certificate_id.length > 256 - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'MinLength': '1'" if !certificate_id.nil? && certificate_id.length < 1 - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !certificate_id.nil? && certificate_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::CertificateCreateOrUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -394,8 +376,8 @@ def create_or_update_async(resource_group_name, service_name, certificate_id, pa # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, certificate_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers).value! nil end @@ -414,8 +396,8 @@ def delete(resource_group_name, service_name, certificate_id, if_match, custom_h # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, certificate_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers).value! end # @@ -433,23 +415,16 @@ def delete_with_http_info(resource_group_name, service_name, certificate_id, if_ # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'MaxLength': '256'" if !certificate_id.nil? && certificate_id.length > 256 - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'MinLength': '1'" if !certificate_id.nil? && certificate_id.length < 1 - fail ArgumentError, "'certificate_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !certificate_id.nil? && certificate_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -495,8 +470,8 @@ def delete_async(resource_group_name, service_name, certificate_id, if_match, cu # # @return [CertificateCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -510,8 +485,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -524,12 +499,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -597,12 +571,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [CertificateCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/group_users.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/group_users.rb index 4830bca61c..9739764943 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/group_users.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/group_users.rb @@ -52,8 +52,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_groups(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_groups_as_lazy(resource_group_name, service_name, group_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_groups(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_groups_as_lazy(resource_group_name, service_name, group_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -88,8 +88,8 @@ def list_by_groups(resource_group_name, service_name, group_id, filter:nil, top: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_groups_with_http_info(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_groups_async(resource_group_name, service_name, group_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_groups_with_http_info(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_groups_async(resource_group_name, service_name, group_id, filter, top, skip, custom_headers).value! end # @@ -123,24 +123,15 @@ def list_by_groups_with_http_info(resource_group_name, service_name, group_id, f # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_groups_async(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_groups_async(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -199,8 +190,8 @@ def list_by_groups_async(resource_group_name, service_name, group_id, filter:nil # # @return [ErrorBodyContract] operation results. # - def create(resource_group_name, service_name, group_id, uid, custom_headers:nil) - response = create_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value! + def create(resource_group_name, service_name, group_id, uid, custom_headers = nil) + response = create_async(resource_group_name, service_name, group_id, uid, custom_headers).value! response.body unless response.nil? end @@ -218,8 +209,8 @@ def create(resource_group_name, service_name, group_id, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers:nil) - create_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value! + def create_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers = nil) + create_async(resource_group_name, service_name, group_id, uid, custom_headers).value! end # @@ -236,26 +227,16 @@ def create_with_http_info(resource_group_name, service_name, group_id, uid, cust # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_async(resource_group_name, service_name, group_id, uid, custom_headers:nil) + def create_async(resource_group_name, service_name, group_id, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -314,8 +295,8 @@ def create_async(resource_group_name, service_name, group_id, uid, custom_header # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, group_id, uid, custom_headers:nil) - response = delete_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, group_id, uid, custom_headers = nil) + response = delete_async(resource_group_name, service_name, group_id, uid, custom_headers).value! response.body unless response.nil? end @@ -333,8 +314,8 @@ def delete(resource_group_name, service_name, group_id, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers:nil) - delete_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers = nil) + delete_async(resource_group_name, service_name, group_id, uid, custom_headers).value! end # @@ -351,26 +332,16 @@ def delete_with_http_info(resource_group_name, service_name, group_id, uid, cust # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, group_id, uid, custom_headers:nil) + def delete_async(resource_group_name, service_name, group_id, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -425,8 +396,8 @@ def delete_async(resource_group_name, service_name, group_id, uid, custom_header # # @return [UserCollection] operation results. # - def list_by_groups_next(next_page_link, custom_headers:nil) - response = list_by_groups_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_groups_next(next_page_link, custom_headers = nil) + response = list_by_groups_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -440,8 +411,8 @@ def list_by_groups_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_groups_next_with_http_info(next_page_link, custom_headers:nil) - list_by_groups_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_groups_next_with_http_info(next_page_link, custom_headers = nil) + list_by_groups_next_async(next_page_link, custom_headers).value! end # @@ -454,12 +425,11 @@ def list_by_groups_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_groups_next_async(next_page_link, custom_headers:nil) + def list_by_groups_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 @@ -534,12 +504,12 @@ def list_by_groups_next_async(next_page_link, custom_headers:nil) # # @return [UserCollection] which provide lazy access to pages of the response. # - def list_by_groups_as_lazy(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_groups_async(resource_group_name, service_name, group_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_groups_as_lazy(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_groups_async(resource_group_name, service_name, group_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_groups_next_async(next_page_link, custom_headers:custom_headers) + list_by_groups_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/groups.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/groups.rb index 64418e305f..528e082441 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/groups.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/groups.rb @@ -44,8 +44,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -72,8 +72,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -99,20 +99,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -169,8 +163,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [GroupContract] operation results. # - def get(resource_group_name, service_name, group_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, group_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, group_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, group_id, custom_headers).value! response.body unless response.nil? end @@ -186,8 +180,8 @@ def get(resource_group_name, service_name, group_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, group_id, custom_headers:nil) - get_async(resource_group_name, service_name, group_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, group_id, custom_headers = nil) + get_async(resource_group_name, service_name, group_id, custom_headers).value! end # @@ -202,22 +196,15 @@ def get_with_http_info(resource_group_name, service_name, group_id, custom_heade # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, group_id, custom_headers:nil) + def get_async(resource_group_name, service_name, group_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -274,8 +261,8 @@ def get_async(resource_group_name, service_name, group_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, group_id, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, group_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers).value! nil end @@ -292,8 +279,8 @@ def create_or_update(resource_group_name, service_name, group_id, parameters, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, group_id, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, group_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers).value! end # @@ -309,28 +296,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, group_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, group_id, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::GroupCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -383,8 +365,8 @@ def create_or_update_async(resource_group_name, service_name, group_id, paramete # # @return [ErrorBodyContract] operation results. # - def update(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers).value! response.body unless response.nil? end @@ -404,8 +386,8 @@ def update(resource_group_name, service_name, group_id, parameters, if_match, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers).value! end # @@ -424,16 +406,10 @@ def update_with_http_info(resource_group_name, service_name, group_id, parameter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -441,13 +417,14 @@ def update_async(resource_group_name, service_name, group_id, parameters, if_mat request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::GroupUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -509,8 +486,8 @@ def update_async(resource_group_name, service_name, group_id, parameters, if_mat # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, group_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, group_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, group_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, group_id, if_match, custom_headers).value! response.body unless response.nil? end @@ -529,8 +506,8 @@ def delete(resource_group_name, service_name, group_id, if_match, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, group_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, group_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, group_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, group_id, if_match, custom_headers).value! end # @@ -548,23 +525,16 @@ def delete_with_http_info(resource_group_name, service_name, group_id, if_match, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, group_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, group_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -620,8 +590,8 @@ def delete_async(resource_group_name, service_name, group_id, if_match, custom_h # # @return [GroupCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -635,8 +605,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -649,12 +619,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -721,12 +690,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # # @return [GroupCollection] which provide lazy access to pages of the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/identity_providers.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/identity_providers.rb index f848aa05ba..249c7d1c04 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/identity_providers.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/identity_providers.rb @@ -32,8 +32,8 @@ def initialize(client) # # @return [IdentityProviderList] operation results. # - def list_by_service(resource_group_name, service_name, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def list_by_service(resource_group_name, service_name, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -48,8 +48,8 @@ def list_by_service(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, custom_headers).value! end # @@ -63,18 +63,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, custom_hea # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, custom_headers:nil) + def list_by_service_async(resource_group_name, service_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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[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 @@ -133,8 +129,8 @@ def list_by_service_async(resource_group_name, service_name, custom_headers:nil) # # @return [IdentityProviderContract] operation results. # - def get(resource_group_name, service_name, identity_provider_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, identity_provider_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, identity_provider_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, identity_provider_name, custom_headers).value! response.body unless response.nil? end @@ -152,8 +148,8 @@ def get(resource_group_name, service_name, identity_provider_name, custom_header # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, identity_provider_name, custom_headers:nil) - get_async(resource_group_name, service_name, identity_provider_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, identity_provider_name, custom_headers = nil) + get_async(resource_group_name, service_name, identity_provider_name, custom_headers).value! end # @@ -170,19 +166,15 @@ def get_with_http_info(resource_group_name, service_name, identity_provider_name # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, identity_provider_name, custom_headers:nil) + def get_async(resource_group_name, service_name, identity_provider_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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'identity_provider_name is nil' if identity_provider_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 @@ -240,8 +232,8 @@ def get_async(resource_group_name, service_name, identity_provider_name, custom_ # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, identity_provider_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers).value! nil end @@ -259,8 +251,8 @@ def create_or_update(resource_group_name, service_name, identity_provider_name, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers).value! end # @@ -277,12 +269,9 @@ def create_or_update_with_http_info(resource_group_name, service_name, identity_ # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -290,12 +279,13 @@ def create_or_update_async(resource_group_name, service_name, identity_provider_ 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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::IdentityProviderContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -348,8 +338,8 @@ def create_or_update_async(resource_group_name, service_name, identity_provider_ # will be added to the HTTP request. # # - def update(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers).value! nil end @@ -370,8 +360,8 @@ def update(resource_group_name, service_name, identity_provider_name, parameters # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers).value! end # @@ -391,12 +381,9 @@ def update_with_http_info(resource_group_name, service_name, identity_provider_n # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? @@ -405,13 +392,14 @@ def update_async(resource_group_name, service_name, identity_provider_name, para request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::IdentityProviderUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -463,8 +451,8 @@ def update_async(resource_group_name, service_name, identity_provider_name, para # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers).value! nil end @@ -484,8 +472,8 @@ def delete(resource_group_name, service_name, identity_provider_name, if_match, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers).value! end # @@ -504,12 +492,9 @@ def delete_with_http_info(resource_group_name, service_name, identity_provider_n # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -517,7 +502,6 @@ def delete_async(resource_group_name, service_name, identity_provider_name, if_m request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/loggers.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/loggers.rb index e010cd8167..a47a277bd8 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/loggers.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/loggers.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -87,20 +87,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -157,8 +151,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [LoggerResponse] operation results. # - def get(resource_group_name, service_name, loggerid, custom_headers:nil) - response = get_async(resource_group_name, service_name, loggerid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, loggerid, custom_headers = nil) + response = get_async(resource_group_name, service_name, loggerid, custom_headers).value! response.body unless response.nil? end @@ -174,8 +168,8 @@ def get(resource_group_name, service_name, loggerid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, loggerid, custom_headers:nil) - get_async(resource_group_name, service_name, loggerid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, loggerid, custom_headers = nil) + get_async(resource_group_name, service_name, loggerid, custom_headers).value! end # @@ -190,21 +184,15 @@ def get_with_http_info(resource_group_name, service_name, loggerid, custom_heade # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, loggerid, custom_headers:nil) + def get_async(resource_group_name, service_name, loggerid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'loggerid is nil' if loggerid.nil? - fail ArgumentError, "'loggerid' should satisfy the constraint - 'MaxLength': '256'" if !loggerid.nil? && loggerid.length > 256 - fail ArgumentError, "'loggerid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !loggerid.nil? && loggerid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -261,8 +249,8 @@ def get_async(resource_group_name, service_name, loggerid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, loggerid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, loggerid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers).value! nil end @@ -279,8 +267,8 @@ def create_or_update(resource_group_name, service_name, loggerid, parameters, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, loggerid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, loggerid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers).value! end # @@ -296,27 +284,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, loggerid, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, loggerid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'loggerid is nil' if loggerid.nil? - fail ArgumentError, "'loggerid' should satisfy the constraint - 'MaxLength': '256'" if !loggerid.nil? && loggerid.length > 256 - fail ArgumentError, "'loggerid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !loggerid.nil? && loggerid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::LoggerCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -368,8 +352,8 @@ def create_or_update_async(resource_group_name, service_name, loggerid, paramete # will be added to the HTTP request. # # - def update(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers).value! nil end @@ -389,8 +373,8 @@ def update(resource_group_name, service_name, loggerid, parameters, if_match, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers).value! end # @@ -409,15 +393,10 @@ def update_with_http_info(resource_group_name, service_name, loggerid, parameter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'loggerid is nil' if loggerid.nil? - fail ArgumentError, "'loggerid' should satisfy the constraint - 'MaxLength': '256'" if !loggerid.nil? && loggerid.length > 256 - fail ArgumentError, "'loggerid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !loggerid.nil? && loggerid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -425,13 +404,14 @@ def update_async(resource_group_name, service_name, loggerid, parameters, if_mat request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::LoggerUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -482,8 +462,8 @@ def update_async(resource_group_name, service_name, loggerid, parameters, if_mat # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, loggerid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers).value! nil end @@ -502,8 +482,8 @@ def delete(resource_group_name, service_name, loggerid, if_match, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, loggerid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers).value! end # @@ -521,22 +501,16 @@ def delete_with_http_info(resource_group_name, service_name, loggerid, if_match, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'loggerid is nil' if loggerid.nil? - fail ArgumentError, "'loggerid' should satisfy the constraint - 'MaxLength': '256'" if !loggerid.nil? && loggerid.length > 256 - fail ArgumentError, "'loggerid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !loggerid.nil? && loggerid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -582,8 +556,8 @@ def delete_async(resource_group_name, service_name, loggerid, if_match, custom_h # # @return [LoggerCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -597,8 +571,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -611,12 +585,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -680,12 +653,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [LoggerCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/access_information_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/access_information_contract.rb index f9ab63c250..7305ddc833 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/access_information_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/access_information_contract.rb @@ -32,7 +32,6 @@ class AccessInformationContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AccessInformationContract', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'AccessInformationContract', model_properties: { id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { @@ -48,7 +46,6 @@ def self.mapper() } }, primary_key: { - client_side_validation: true, required: false, serialized_name: 'primaryKey', type: { @@ -56,7 +53,6 @@ def self.mapper() } }, secondary_key: { - client_side_validation: true, required: false, serialized_name: 'secondaryKey', type: { @@ -64,7 +60,6 @@ def self.mapper() } }, enabled: { - client_side_validation: true, required: false, serialized_name: 'enabled', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb index f1525f8fcb..364030c0e8 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb @@ -24,7 +24,6 @@ class AccessInformationUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AccessInformationUpdateParameters', type: { @@ -32,7 +31,6 @@ def self.mapper() class_name: 'AccessInformationUpdateParameters', model_properties: { enabled: { - client_side_validation: true, required: true, serialized_name: 'enabled', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/additional_region.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/additional_region.rb index a903d30ae1..1f2e3dd3f1 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/additional_region.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/additional_region.rb @@ -41,7 +41,6 @@ class AdditionalRegion # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AdditionalRegion', type: { @@ -49,7 +48,6 @@ def self.mapper() class_name: 'AdditionalRegion', model_properties: { location: { - client_side_validation: true, required: true, serialized_name: 'location', type: { @@ -57,7 +55,6 @@ def self.mapper() } }, sku_type: { - client_side_validation: true, required: true, serialized_name: 'skuType', type: { @@ -66,7 +63,6 @@ def self.mapper() } }, sku_unit_count: { - client_side_validation: true, required: false, serialized_name: 'skuUnitCount', default_value: 1, @@ -78,14 +74,12 @@ def self.mapper() } }, static_ips: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'staticIPs', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -95,7 +89,6 @@ def self.mapper() } }, vpnconfiguration: { - client_side_validation: true, required: false, serialized_name: 'vpnconfiguration', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_collection.rb index 0f73c57ce2..8075162e23 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'ApiCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ApiContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_contract.rb index 0c8ff8eb0e..b0a5e415c5 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_contract.rb @@ -39,7 +39,6 @@ class ApiContract < ApiEntityBaseContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiContract', type: { @@ -47,7 +46,6 @@ def self.mapper() class_name: 'ApiContract', model_properties: { description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -55,7 +53,6 @@ def self.mapper() } }, authentication_settings: { - client_side_validation: true, required: false, serialized_name: 'authenticationSettings', type: { @@ -64,7 +61,6 @@ def self.mapper() } }, subscription_key_parameter_names: { - client_side_validation: true, required: false, serialized_name: 'subscriptionKeyParameterNames', type: { @@ -73,7 +69,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { @@ -82,7 +77,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -91,7 +85,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -103,7 +96,6 @@ def self.mapper() } }, service_url: { - client_side_validation: true, required: true, serialized_name: 'serviceUrl', constraints: { @@ -115,7 +107,6 @@ def self.mapper() } }, path: { - client_side_validation: true, required: true, serialized_name: 'path', constraints: { @@ -127,13 +118,11 @@ def self.mapper() } }, protocols: { - client_side_validation: true, required: true, serialized_name: 'protocols', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ApiProtocolContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_entity_base_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_entity_base_contract.rb index 2bac534f65..8d7955320f 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_entity_base_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_entity_base_contract.rb @@ -35,7 +35,6 @@ class ApiEntityBaseContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiEntityBaseContract', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'ApiEntityBaseContract', model_properties: { description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -51,7 +49,6 @@ def self.mapper() } }, authentication_settings: { - client_side_validation: true, required: false, serialized_name: 'authenticationSettings', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, subscription_key_parameter_names: { - client_side_validation: true, required: false, serialized_name: 'subscriptionKeyParameterNames', type: { @@ -69,7 +65,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_export_result.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_export_result.rb index 1edc0c079f..6553761abe 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_export_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_export_result.rb @@ -29,7 +29,6 @@ class ApiExportResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiExportResult', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'ApiExportResult', model_properties: { content: { - client_side_validation: true, required: false, serialized_name: 'content', type: { @@ -45,7 +43,6 @@ def self.mapper() } }, status_code: { - client_side_validation: true, required: false, serialized_name: 'statusCode', type: { @@ -54,7 +51,6 @@ def self.mapper() } }, request_id: { - client_side_validation: true, required: false, serialized_name: 'requestId', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb index c81297e071..c78bc06d25 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb @@ -36,7 +36,6 @@ class ApiManagementServiceBackupRestoreParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceBackupRestoreParameters', type: { @@ -44,7 +43,6 @@ def self.mapper() class_name: 'ApiManagementServiceBackupRestoreParameters', model_properties: { storage_account: { - client_side_validation: true, required: true, serialized_name: 'storageAccount', type: { @@ -52,7 +50,6 @@ def self.mapper() } }, access_key: { - client_side_validation: true, required: true, serialized_name: 'accessKey', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, container_name: { - client_side_validation: true, required: true, serialized_name: 'containerName', type: { @@ -68,7 +64,6 @@ def self.mapper() } }, backup_name: { - client_side_validation: true, required: true, serialized_name: 'backupName', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb index a452da0ef2..ae749483b5 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb @@ -23,7 +23,6 @@ class ApiManagementServiceCheckNameAvailabilityParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceCheckNameAvailabilityParameters', type: { @@ -31,7 +30,6 @@ def self.mapper() class_name: 'ApiManagementServiceCheckNameAvailabilityParameters', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb index 99fbb9ad02..a3c138bed4 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb @@ -22,7 +22,6 @@ class ApiManagementServiceGetSsoTokenResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceGetSsoTokenResult', type: { @@ -30,7 +29,6 @@ def self.mapper() class_name: 'ApiManagementServiceGetSsoTokenResult', model_properties: { redirect_uri: { - client_side_validation: true, required: false, serialized_name: 'redirect_uri', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb index efa20bf28b..cc46100322 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb @@ -59,7 +59,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceListResult', type: { @@ -67,13 +66,11 @@ def self.mapper() class_name: 'ApiManagementServiceListResult', model_properties: { value: { - client_side_validation: true, required: true, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceResourceElementType', type: { @@ -84,7 +81,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_manage_deployments_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_manage_deployments_parameters.rb index a869ceb71a..22cae317f6 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_manage_deployments_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_manage_deployments_parameters.rb @@ -50,7 +50,6 @@ class ApiManagementServiceManageDeploymentsParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceManageDeploymentsParameters', type: { @@ -58,7 +57,6 @@ def self.mapper() class_name: 'ApiManagementServiceManageDeploymentsParameters', model_properties: { location: { - client_side_validation: true, required: true, serialized_name: 'location', type: { @@ -66,7 +64,6 @@ def self.mapper() } }, sku_type: { - client_side_validation: true, required: true, serialized_name: 'skuType', type: { @@ -75,7 +72,6 @@ def self.mapper() } }, sku_unit_count: { - client_side_validation: true, required: false, serialized_name: 'skuUnitCount', default_value: 1, @@ -84,13 +80,11 @@ def self.mapper() } }, additional_locations: { - client_side_validation: true, required: false, serialized_name: 'additionalLocations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'AdditionalRegionElementType', type: { @@ -101,7 +95,6 @@ def self.mapper() } }, vpn_configuration: { - client_side_validation: true, required: false, serialized_name: 'vpnConfiguration', type: { @@ -110,7 +103,6 @@ def self.mapper() } }, vpn_type: { - client_side_validation: true, required: false, serialized_name: 'vpnType', default_value: 'None', diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb index deeff392c8..dab4618dc7 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb @@ -38,7 +38,6 @@ class ApiManagementServiceNameAvailabilityResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceNameAvailabilityResult', type: { @@ -46,7 +45,6 @@ def self.mapper() class_name: 'ApiManagementServiceNameAvailabilityResult', model_properties: { name_available: { - client_side_validation: true, required: true, serialized_name: 'nameAvailable', type: { @@ -54,7 +52,6 @@ def self.mapper() } }, message: { - client_side_validation: true, required: false, serialized_name: 'message', type: { @@ -62,7 +59,6 @@ def self.mapper() } }, reason: { - client_side_validation: true, required: false, serialized_name: 'reason', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_resource.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_resource.rb index 3300139e4c..0f3fca2156 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_resource.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_resource.rb @@ -93,7 +93,6 @@ class ApiManagementServiceResource < Resource # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceResource', type: { @@ -101,7 +100,6 @@ def self.mapper() class_name: 'ApiManagementServiceResource', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -110,7 +108,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, serialized_name: 'name', type: { @@ -118,7 +115,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'type', @@ -127,7 +123,6 @@ def self.mapper() } }, location: { - client_side_validation: true, required: true, serialized_name: 'location', type: { @@ -135,13 +130,11 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -151,7 +144,6 @@ def self.mapper() } }, publisher_email: { - client_side_validation: true, required: true, serialized_name: 'properties.publisherEmail', constraints: { @@ -162,7 +154,6 @@ def self.mapper() } }, publisher_name: { - client_side_validation: true, required: true, serialized_name: 'properties.publisherName', type: { @@ -170,7 +161,6 @@ def self.mapper() } }, provisioning_state: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.provisioningState', @@ -179,7 +169,6 @@ def self.mapper() } }, target_provisioning_state: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.targetProvisioningState', @@ -188,7 +177,6 @@ def self.mapper() } }, created_at_utc: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.createdAtUtc', @@ -197,7 +185,6 @@ def self.mapper() } }, runtime_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.runtimeUrl', @@ -206,7 +193,6 @@ def self.mapper() } }, portal_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.portalUrl', @@ -215,7 +201,6 @@ def self.mapper() } }, management_api_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.managementApiUrl', @@ -224,7 +209,6 @@ def self.mapper() } }, scm_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.scmUrl', @@ -233,7 +217,6 @@ def self.mapper() } }, addresser_email: { - client_side_validation: true, required: false, serialized_name: 'properties.addresserEmail', type: { @@ -241,13 +224,11 @@ def self.mapper() } }, hostname_configurations: { - client_side_validation: true, required: false, serialized_name: 'properties.hostnameConfigurations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'HostnameConfigurationElementType', type: { @@ -258,14 +239,12 @@ def self.mapper() } }, static_ips: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.staticIPs', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -275,7 +254,6 @@ def self.mapper() } }, vpnconfiguration: { - client_side_validation: true, required: false, serialized_name: 'properties.vpnconfiguration', type: { @@ -284,13 +262,11 @@ def self.mapper() } }, additional_locations: { - client_side_validation: true, required: false, serialized_name: 'properties.additionalLocations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'AdditionalRegionElementType', type: { @@ -301,13 +277,11 @@ def self.mapper() } }, custom_properties: { - client_side_validation: true, required: false, serialized_name: 'properties.customProperties', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -317,7 +291,6 @@ def self.mapper() } }, vpn_type: { - client_side_validation: true, required: false, serialized_name: 'properties.vpnType', default_value: 'None', @@ -327,7 +300,6 @@ def self.mapper() } }, sku: { - client_side_validation: true, required: true, serialized_name: 'sku', type: { @@ -336,7 +308,6 @@ def self.mapper() } }, etag: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'etag', diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb index d17d47c024..ab981ef275 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb @@ -27,7 +27,6 @@ class ApiManagementServiceSkuProperties # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceSkuProperties', type: { @@ -35,7 +34,6 @@ def self.mapper() class_name: 'ApiManagementServiceSkuProperties', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { @@ -44,7 +42,6 @@ def self.mapper() } }, capacity: { - client_side_validation: true, required: false, serialized_name: 'capacity', default_value: 1, diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb index 358e7f31b1..7ca0573503 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb @@ -26,7 +26,6 @@ class ApiManagementServiceUpdateHostnameParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceUpdateHostnameParameters', type: { @@ -34,13 +33,11 @@ def self.mapper() class_name: 'ApiManagementServiceUpdateHostnameParameters', model_properties: { update: { - client_side_validation: true, required: false, serialized_name: 'update', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'HostnameConfigurationElementType', type: { @@ -51,13 +48,11 @@ def self.mapper() } }, delete: { - client_side_validation: true, required: false, serialized_name: 'delete', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'HostnameTypeElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_update_parameters.rb index 5fbb55049b..4efe27864f 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_update_parameters.rb @@ -93,7 +93,6 @@ class ApiManagementServiceUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceUpdateParameters', type: { @@ -101,7 +100,6 @@ def self.mapper() class_name: 'ApiManagementServiceUpdateParameters', model_properties: { publisher_email: { - client_side_validation: true, required: true, serialized_name: 'properties.publisherEmail', constraints: { @@ -112,7 +110,6 @@ def self.mapper() } }, publisher_name: { - client_side_validation: true, required: true, serialized_name: 'properties.publisherName', type: { @@ -120,7 +117,6 @@ def self.mapper() } }, provisioning_state: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.provisioningState', @@ -129,7 +125,6 @@ def self.mapper() } }, target_provisioning_state: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.targetProvisioningState', @@ -138,7 +133,6 @@ def self.mapper() } }, created_at_utc: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.createdAtUtc', @@ -147,7 +141,6 @@ def self.mapper() } }, runtime_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.runtimeUrl', @@ -156,7 +149,6 @@ def self.mapper() } }, portal_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.portalUrl', @@ -165,7 +157,6 @@ def self.mapper() } }, management_api_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.managementApiUrl', @@ -174,7 +165,6 @@ def self.mapper() } }, scm_url: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.scmUrl', @@ -183,7 +173,6 @@ def self.mapper() } }, addresser_email: { - client_side_validation: true, required: false, serialized_name: 'properties.addresserEmail', type: { @@ -191,13 +180,11 @@ def self.mapper() } }, hostname_configurations: { - client_side_validation: true, required: false, serialized_name: 'properties.hostnameConfigurations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'HostnameConfigurationElementType', type: { @@ -208,14 +195,12 @@ def self.mapper() } }, static_ips: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.staticIPs', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -225,7 +210,6 @@ def self.mapper() } }, vpnconfiguration: { - client_side_validation: true, required: false, serialized_name: 'properties.vpnconfiguration', type: { @@ -234,13 +218,11 @@ def self.mapper() } }, additional_locations: { - client_side_validation: true, required: false, serialized_name: 'properties.additionalLocations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'AdditionalRegionElementType', type: { @@ -251,13 +233,11 @@ def self.mapper() } }, custom_properties: { - client_side_validation: true, required: false, serialized_name: 'properties.customProperties', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -267,7 +247,6 @@ def self.mapper() } }, vpn_type: { - client_side_validation: true, required: false, serialized_name: 'properties.vpnType', default_value: 'None', @@ -277,7 +256,6 @@ def self.mapper() } }, sku: { - client_side_validation: true, required: false, serialized_name: 'sku', type: { @@ -286,13 +264,11 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb index 7a2d8d5c17..d61d2fbdb5 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb @@ -31,7 +31,6 @@ class ApiManagementServiceUploadCertificateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiManagementServiceUploadCertificateParameters', type: { @@ -39,7 +38,6 @@ def self.mapper() class_name: 'ApiManagementServiceUploadCertificateParameters', model_properties: { type: { - client_side_validation: true, required: true, serialized_name: 'type', type: { @@ -48,7 +46,6 @@ def self.mapper() } }, certificate: { - client_side_validation: true, required: true, serialized_name: 'certificate', type: { @@ -56,7 +53,6 @@ def self.mapper() } }, certificate_password: { - client_side_validation: true, required: true, serialized_name: 'certificate_password', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_update_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_update_contract.rb index b3b39e3536..f8e52fa611 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_update_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/api_update_contract.rb @@ -39,7 +39,6 @@ class ApiUpdateContract < ApiEntityBaseContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ApiUpdateContract', type: { @@ -47,7 +46,6 @@ def self.mapper() class_name: 'ApiUpdateContract', model_properties: { description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -55,7 +53,6 @@ def self.mapper() } }, authentication_settings: { - client_side_validation: true, required: false, serialized_name: 'authenticationSettings', type: { @@ -64,7 +61,6 @@ def self.mapper() } }, subscription_key_parameter_names: { - client_side_validation: true, required: false, serialized_name: 'subscriptionKeyParameterNames', type: { @@ -73,7 +69,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { @@ -82,7 +77,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -91,7 +85,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -103,7 +96,6 @@ def self.mapper() } }, service_url: { - client_side_validation: true, required: false, serialized_name: 'serviceUrl', constraints: { @@ -115,7 +107,6 @@ def self.mapper() } }, path: { - client_side_validation: true, required: false, serialized_name: 'path', constraints: { @@ -127,13 +118,11 @@ def self.mapper() } }, protocols: { - client_side_validation: true, required: false, serialized_name: 'protocols', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ApiProtocolContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb index 5772b41fb6..912a4ecb04 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb @@ -22,7 +22,6 @@ class AuthenticationSettingsContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AuthenticationSettingsContract', type: { @@ -30,7 +29,6 @@ def self.mapper() class_name: 'AuthenticationSettingsContract', model_properties: { o_auth2: { - client_side_validation: true, required: false, serialized_name: 'oAuth2', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/authorization_server_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/authorization_server_collection.rb index 1d352c9492..18b7595c34 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/authorization_server_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/authorization_server_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'AuthorizationServerCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'AuthorizationServerCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'OAuth2AuthorizationServerContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_authorization_header_credentials.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_authorization_header_credentials.rb index 04ef331ce6..fb03fcfb46 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_authorization_header_credentials.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_authorization_header_credentials.rb @@ -25,7 +25,6 @@ class BackendAuthorizationHeaderCredentials # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendAuthorizationHeaderCredentials', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'BackendAuthorizationHeaderCredentials', model_properties: { scheme: { - client_side_validation: true, required: true, serialized_name: 'scheme', constraints: { @@ -45,7 +43,6 @@ def self.mapper() } }, parameter: { - client_side_validation: true, required: true, serialized_name: 'parameter', constraints: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_base_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_base_parameters.rb index 4883b135e9..63e4bfb0cd 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_base_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_base_parameters.rb @@ -60,7 +60,6 @@ class BackendBaseParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendBaseParameters', type: { @@ -68,7 +67,6 @@ def self.mapper() class_name: 'BackendBaseParameters', model_properties: { certificate: { - client_side_validation: true, required: false, serialized_name: 'certificate', constraints: { @@ -77,7 +75,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -87,19 +84,16 @@ def self.mapper() } }, query: { - client_side_validation: true, required: false, serialized_name: 'query', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -111,19 +105,16 @@ def self.mapper() } }, header: { - client_side_validation: true, required: false, serialized_name: 'header', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -135,7 +126,6 @@ def self.mapper() } }, url: { - client_side_validation: true, required: true, serialized_name: 'url', constraints: { @@ -147,7 +137,6 @@ def self.mapper() } }, username: { - client_side_validation: true, required: false, serialized_name: 'username', type: { @@ -155,7 +144,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: false, serialized_name: 'password', type: { @@ -163,7 +151,6 @@ def self.mapper() } }, title: { - client_side_validation: true, required: false, serialized_name: 'title', constraints: { @@ -175,7 +162,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -187,7 +173,6 @@ def self.mapper() } }, resource_id: { - client_side_validation: true, required: false, serialized_name: 'resourceId', constraints: { @@ -199,7 +184,6 @@ def self.mapper() } }, skip_certificate_chain_validation: { - client_side_validation: true, required: false, serialized_name: 'properties.skipCertificateChainValidation', default_value: false, @@ -208,7 +192,6 @@ def self.mapper() } }, skip_certificate_name_validation: { - client_side_validation: true, required: false, serialized_name: 'properties.skipCertificateNameValidation', default_value: false, diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_collection.rb index ab4486f5b1..80d7dad5e2 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'BackendCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'BackendResponseElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_contract.rb index c8ebc4b1ba..34e3cfc0d8 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_contract.rb @@ -29,7 +29,6 @@ class BackendContract < BackendBaseParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendContract', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'BackendContract', model_properties: { certificate: { - client_side_validation: true, required: false, serialized_name: 'certificate', constraints: { @@ -46,7 +44,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -56,19 +53,16 @@ def self.mapper() } }, query: { - client_side_validation: true, required: false, serialized_name: 'query', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -80,19 +74,16 @@ def self.mapper() } }, header: { - client_side_validation: true, required: false, serialized_name: 'header', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -104,7 +95,6 @@ def self.mapper() } }, url: { - client_side_validation: true, required: true, serialized_name: 'url', constraints: { @@ -116,7 +106,6 @@ def self.mapper() } }, username: { - client_side_validation: true, required: false, serialized_name: 'username', type: { @@ -124,7 +113,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: false, serialized_name: 'password', type: { @@ -132,7 +120,6 @@ def self.mapper() } }, title: { - client_side_validation: true, required: false, serialized_name: 'title', constraints: { @@ -144,7 +131,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -156,7 +142,6 @@ def self.mapper() } }, resource_id: { - client_side_validation: true, required: false, serialized_name: 'resourceId', constraints: { @@ -168,7 +153,6 @@ def self.mapper() } }, skip_certificate_chain_validation: { - client_side_validation: true, required: false, serialized_name: 'properties.skipCertificateChainValidation', default_value: false, @@ -177,7 +161,6 @@ def self.mapper() } }, skip_certificate_name_validation: { - client_side_validation: true, required: false, serialized_name: 'properties.skipCertificateNameValidation', default_value: false, @@ -186,7 +169,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -195,7 +177,6 @@ def self.mapper() } }, protocol: { - client_side_validation: true, required: true, serialized_name: 'protocol', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_credentials_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_credentials_contract.rb index 823338b0e3..56e58564bb 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_credentials_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_credentials_contract.rb @@ -28,7 +28,6 @@ class BackendCredentialsContract < BackendAuthorizationHeaderCredentials # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendCredentialsContract', type: { @@ -36,7 +35,6 @@ def self.mapper() class_name: 'BackendCredentialsContract', model_properties: { scheme: { - client_side_validation: true, required: true, serialized_name: 'scheme', constraints: { @@ -48,7 +46,6 @@ def self.mapper() } }, parameter: { - client_side_validation: true, required: true, serialized_name: 'parameter', constraints: { @@ -60,7 +57,6 @@ def self.mapper() } }, certificate: { - client_side_validation: true, required: false, serialized_name: 'certificate', constraints: { @@ -69,7 +65,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -79,19 +74,16 @@ def self.mapper() } }, query: { - client_side_validation: true, required: false, serialized_name: 'query', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -103,19 +95,16 @@ def self.mapper() } }, header: { - client_side_validation: true, required: false, serialized_name: 'header', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_proxy_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_proxy_contract.rb index a4b94aa5f1..8e2a571ee8 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_proxy_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_proxy_contract.rb @@ -30,7 +30,6 @@ class BackendProxyContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendProxyContract', type: { @@ -38,7 +37,6 @@ def self.mapper() class_name: 'BackendProxyContract', model_properties: { url: { - client_side_validation: true, required: true, serialized_name: 'url', constraints: { @@ -50,7 +48,6 @@ def self.mapper() } }, username: { - client_side_validation: true, required: false, serialized_name: 'username', type: { @@ -58,7 +55,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: false, serialized_name: 'password', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_response.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_response.rb index ef5177a235..a1cef3bdf7 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_response.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_response.rb @@ -21,7 +21,6 @@ class BackendResponse < BackendContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendResponse', type: { @@ -29,7 +28,6 @@ def self.mapper() class_name: 'BackendResponse', model_properties: { certificate: { - client_side_validation: true, required: false, serialized_name: 'certificate', constraints: { @@ -38,7 +36,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -48,19 +45,16 @@ def self.mapper() } }, query: { - client_side_validation: true, required: false, serialized_name: 'query', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -72,19 +66,16 @@ def self.mapper() } }, header: { - client_side_validation: true, required: false, serialized_name: 'header', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -96,7 +87,6 @@ def self.mapper() } }, url: { - client_side_validation: true, required: true, serialized_name: 'url', constraints: { @@ -108,7 +98,6 @@ def self.mapper() } }, username: { - client_side_validation: true, required: false, serialized_name: 'username', type: { @@ -116,7 +105,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: false, serialized_name: 'password', type: { @@ -124,7 +112,6 @@ def self.mapper() } }, title: { - client_side_validation: true, required: false, serialized_name: 'title', constraints: { @@ -136,7 +123,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -148,7 +134,6 @@ def self.mapper() } }, resource_id: { - client_side_validation: true, required: false, serialized_name: 'resourceId', constraints: { @@ -160,7 +145,6 @@ def self.mapper() } }, skip_certificate_chain_validation: { - client_side_validation: true, required: false, serialized_name: 'properties.skipCertificateChainValidation', default_value: false, @@ -169,7 +153,6 @@ def self.mapper() } }, skip_certificate_name_validation: { - client_side_validation: true, required: false, serialized_name: 'properties.skipCertificateNameValidation', default_value: false, @@ -178,7 +161,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -187,7 +169,6 @@ def self.mapper() } }, protocol: { - client_side_validation: true, required: true, serialized_name: 'protocol', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_update_parameters.rb index b94f9270ac..80d1f23c56 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/backend_update_parameters.rb @@ -23,7 +23,6 @@ class BackendUpdateParameters < BackendBaseParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'BackendUpdateParameters', type: { @@ -31,7 +30,6 @@ def self.mapper() class_name: 'BackendUpdateParameters', model_properties: { certificate: { - client_side_validation: true, required: false, serialized_name: 'certificate', constraints: { @@ -40,7 +38,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -50,19 +47,16 @@ def self.mapper() } }, query: { - client_side_validation: true, required: false, serialized_name: 'query', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -74,19 +68,16 @@ def self.mapper() } }, header: { - client_side_validation: true, required: false, serialized_name: 'header', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'ArrayElementType', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -98,7 +89,6 @@ def self.mapper() } }, url: { - client_side_validation: true, required: true, serialized_name: 'url', constraints: { @@ -110,7 +100,6 @@ def self.mapper() } }, username: { - client_side_validation: true, required: false, serialized_name: 'username', type: { @@ -118,7 +107,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: false, serialized_name: 'password', type: { @@ -126,7 +114,6 @@ def self.mapper() } }, title: { - client_side_validation: true, required: false, serialized_name: 'title', constraints: { @@ -138,7 +125,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -150,7 +136,6 @@ def self.mapper() } }, resource_id: { - client_side_validation: true, required: false, serialized_name: 'resourceId', constraints: { @@ -162,7 +147,6 @@ def self.mapper() } }, skip_certificate_chain_validation: { - client_side_validation: true, required: false, serialized_name: 'properties.skipCertificateChainValidation', default_value: false, @@ -171,7 +155,6 @@ def self.mapper() } }, skip_certificate_name_validation: { - client_side_validation: true, required: false, serialized_name: 'properties.skipCertificateNameValidation', default_value: false, @@ -180,7 +163,6 @@ def self.mapper() } }, protocol: { - client_side_validation: true, required: false, serialized_name: 'protocol', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_collection.rb index 25e15c76ff..56a9e6bbb6 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'CertificateCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'CertificateCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'CertificateContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_contract.rb index 42dca016f5..651dc1f4c0 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_contract.rb @@ -35,7 +35,6 @@ class CertificateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'CertificateContract', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'CertificateContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -52,7 +50,6 @@ def self.mapper() } }, subject: { - client_side_validation: true, required: true, serialized_name: 'subject', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, thumbprint: { - client_side_validation: true, required: true, serialized_name: 'thumbprint', type: { @@ -68,7 +64,6 @@ def self.mapper() } }, expiration_date: { - client_side_validation: true, required: true, serialized_name: 'expirationDate', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb index f0c5eacd3e..9db2994ccc 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb @@ -26,7 +26,6 @@ class CertificateCreateOrUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'CertificateCreateOrUpdateParameters', type: { @@ -34,7 +33,6 @@ def self.mapper() class_name: 'CertificateCreateOrUpdateParameters', model_properties: { data: { - client_side_validation: true, required: true, serialized_name: 'data', type: { @@ -42,7 +40,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: true, serialized_name: 'password', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_information.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_information.rb index 34c3ef5cc6..0ffac4851b 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_information.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/certificate_information.rb @@ -30,7 +30,6 @@ class CertificateInformation # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'CertificateInformation', type: { @@ -38,7 +37,6 @@ def self.mapper() class_name: 'CertificateInformation', model_properties: { expiry: { - client_side_validation: true, required: true, serialized_name: 'expiry', type: { @@ -46,7 +44,6 @@ def self.mapper() } }, thumbprint: { - client_side_validation: true, required: true, serialized_name: 'thumbprint', type: { @@ -54,7 +51,6 @@ def self.mapper() } }, subject: { - client_side_validation: true, required: true, serialized_name: 'subject', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/connectivity_status_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/connectivity_status_contract.rb index f3cce4d4f2..b8dddd203e 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/connectivity_status_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/connectivity_status_contract.rb @@ -45,7 +45,6 @@ class ConnectivityStatusContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ConnectivityStatusContract', type: { @@ -53,7 +52,6 @@ def self.mapper() class_name: 'ConnectivityStatusContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -64,7 +62,6 @@ def self.mapper() } }, status: { - client_side_validation: true, required: true, serialized_name: 'status', type: { @@ -72,7 +69,6 @@ def self.mapper() } }, error: { - client_side_validation: true, required: false, serialized_name: 'error', type: { @@ -80,7 +76,6 @@ def self.mapper() } }, last_updated: { - client_side_validation: true, required: true, serialized_name: 'lastUpdated', type: { @@ -88,7 +83,6 @@ def self.mapper() } }, last_status_change: { - client_side_validation: true, required: true, serialized_name: 'lastStatusChange', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb index 31bf1e04a2..acb50f20d4 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb @@ -27,7 +27,6 @@ class DeployConfigurationParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'DeployConfigurationParameters', type: { @@ -35,7 +34,6 @@ def self.mapper() class_name: 'DeployConfigurationParameters', model_properties: { branch: { - client_side_validation: true, required: true, serialized_name: 'branch', type: { @@ -43,7 +41,6 @@ def self.mapper() } }, force: { - client_side_validation: true, required: false, serialized_name: 'force', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_body_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_body_contract.rb index 18ad49051b..687b988bcf 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_body_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_body_contract.rb @@ -30,7 +30,6 @@ class ErrorBodyContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ErrorBodyContract', type: { @@ -38,7 +37,6 @@ def self.mapper() class_name: 'ErrorBodyContract', model_properties: { code: { - client_side_validation: true, required: false, serialized_name: 'code', type: { @@ -46,7 +44,6 @@ def self.mapper() } }, message: { - client_side_validation: true, required: false, serialized_name: 'message', type: { @@ -54,13 +51,11 @@ def self.mapper() } }, details: { - client_side_validation: true, required: false, serialized_name: 'details', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ErrorFieldContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_field_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_field_contract.rb index 10dae1d615..2f51a5e3e1 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_field_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_field_contract.rb @@ -28,7 +28,6 @@ class ErrorFieldContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ErrorFieldContract', type: { @@ -36,7 +35,6 @@ def self.mapper() class_name: 'ErrorFieldContract', model_properties: { code: { - client_side_validation: true, required: false, serialized_name: 'code', type: { @@ -44,7 +42,6 @@ def self.mapper() } }, message: { - client_side_validation: true, required: false, serialized_name: 'message', type: { @@ -52,7 +49,6 @@ def self.mapper() } }, target: { - client_side_validation: true, required: false, serialized_name: 'target', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_response.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_response.rb index d967515137..c3055ccb74 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_response.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/error_response.rb @@ -25,7 +25,6 @@ class ErrorResponse # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ErrorResponse', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'ErrorResponse', model_properties: { code: { - client_side_validation: true, required: false, serialized_name: 'code', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, message: { - client_side_validation: true, required: false, serialized_name: 'message', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb index fcc1762c35..0116e21f59 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb @@ -22,7 +22,6 @@ class GenerateSsoUrlResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GenerateSsoUrlResult', type: { @@ -30,7 +29,6 @@ def self.mapper() class_name: 'GenerateSsoUrlResult', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_collection.rb index 408f56597a..1da1191d22 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GroupCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'GroupCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'GroupContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_contract.rb index 9cb572d13c..265fb99ea7 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_contract.rb @@ -44,7 +44,6 @@ class GroupContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GroupContract', type: { @@ -52,7 +51,6 @@ def self.mapper() class_name: 'GroupContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -61,7 +59,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -73,7 +70,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -84,7 +80,6 @@ def self.mapper() } }, built_in: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'builtIn', @@ -93,7 +88,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'type', @@ -103,7 +97,6 @@ def self.mapper() } }, external_id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'externalId', diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_create_parameters.rb index 9b2da7bb10..e80190c2e2 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_create_parameters.rb @@ -35,7 +35,6 @@ class GroupCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GroupCreateParameters', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'GroupCreateParameters', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -55,7 +53,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -63,7 +60,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { @@ -72,7 +68,6 @@ def self.mapper() } }, external_id: { - client_side_validation: true, required: false, serialized_name: 'externalId', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_update_parameters.rb index e25e9b483b..cc6c6e63df 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/group_update_parameters.rb @@ -35,7 +35,6 @@ class GroupUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'GroupUpdateParameters', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'GroupUpdateParameters', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -55,7 +53,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -63,7 +60,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { @@ -72,7 +68,6 @@ def self.mapper() } }, external_id: { - client_side_validation: true, required: false, serialized_name: 'externalId', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/hostname_configuration.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/hostname_configuration.rb index 3e4c5d9ad2..1cdddc2471 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/hostname_configuration.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/hostname_configuration.rb @@ -29,7 +29,6 @@ class HostnameConfiguration # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'HostnameConfiguration', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'HostnameConfiguration', model_properties: { type: { - client_side_validation: true, required: true, serialized_name: 'type', type: { @@ -46,7 +44,6 @@ def self.mapper() } }, hostname: { - client_side_validation: true, required: true, serialized_name: 'hostname', type: { @@ -54,7 +51,6 @@ def self.mapper() } }, certificate: { - client_side_validation: true, required: true, serialized_name: 'certificate', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_contract.rb index cb28dd91ca..c97ae7b171 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_contract.rb @@ -41,7 +41,6 @@ class IdentityProviderContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'IdentityProviderContract', type: { @@ -49,7 +48,6 @@ def self.mapper() class_name: 'IdentityProviderContract', model_properties: { client_id: { - client_side_validation: true, required: true, serialized_name: 'clientId', constraints: { @@ -60,7 +58,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: true, serialized_name: 'clientSecret', constraints: { @@ -71,7 +68,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, serialized_name: 'type', type: { @@ -79,7 +75,6 @@ def self.mapper() } }, allowed_tenants: { - client_side_validation: true, required: false, serialized_name: 'allowedTenants', constraints: { @@ -88,7 +83,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_list.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_list.rb index 71b9595eda..d0b310d4a9 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_list.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_list.rb @@ -23,7 +23,6 @@ class IdentityProviderList # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'IdentityProviderList', type: { @@ -31,13 +30,11 @@ def self.mapper() class_name: 'IdentityProviderList', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'IdentityProviderContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb index 7d95c9743b..72b54ad89c 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb @@ -34,7 +34,6 @@ class IdentityProviderUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'IdentityProviderUpdateParameters', type: { @@ -42,7 +41,6 @@ def self.mapper() class_name: 'IdentityProviderUpdateParameters', model_properties: { client_id: { - client_side_validation: true, required: false, serialized_name: 'clientId', constraints: { @@ -53,7 +51,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', constraints: { @@ -64,7 +61,6 @@ def self.mapper() } }, allowed_tenants: { - client_side_validation: true, required: false, serialized_name: 'allowedTenants', constraints: { @@ -73,7 +69,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_collection.rb index 119f620721..8c81b951f7 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'LoggerCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'LoggerCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'LoggerResponseElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_create_parameters.rb index c7965cc6f0..119296a1c2 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_create_parameters.rb @@ -33,7 +33,6 @@ class LoggerCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'LoggerCreateParameters', type: { @@ -41,7 +40,6 @@ def self.mapper() class_name: 'LoggerCreateParameters', model_properties: { type: { - client_side_validation: true, required: true, is_constant: true, serialized_name: 'type', @@ -51,7 +49,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -59,13 +56,11 @@ def self.mapper() } }, credentials: { - client_side_validation: true, required: true, serialized_name: 'credentials', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -75,7 +70,6 @@ def self.mapper() } }, is_buffered: { - client_side_validation: true, required: false, serialized_name: 'isBuffered', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_response.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_response.rb index fffd45c114..cd158ff6c8 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_response.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_response.rb @@ -40,7 +40,6 @@ class LoggerResponse # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'LoggerResponse', type: { @@ -48,7 +47,6 @@ def self.mapper() class_name: 'LoggerResponse', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -57,7 +55,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: true, is_constant: true, serialized_name: 'type', @@ -67,7 +64,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -78,13 +74,11 @@ def self.mapper() } }, credentials: { - client_side_validation: true, required: true, serialized_name: 'credentials', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -94,7 +88,6 @@ def self.mapper() } }, is_buffered: { - client_side_validation: true, required: false, serialized_name: 'isBuffered', default_value: true, diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_update_parameters.rb index f46ec41ce4..866deb0a39 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/logger_update_parameters.rb @@ -32,7 +32,6 @@ class LoggerUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'LoggerUpdateParameters', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'LoggerUpdateParameters', model_properties: { type: { - client_side_validation: true, required: true, is_constant: true, serialized_name: 'type', @@ -50,7 +48,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -58,13 +55,11 @@ def self.mapper() } }, credentials: { - client_side_validation: true, required: false, serialized_name: 'credentials', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -74,7 +69,6 @@ def self.mapper() } }, is_buffered: { - client_side_validation: true, required: false, serialized_name: 'isBuffered', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/network_status_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/network_status_contract.rb index aeddb395b7..27c0574568 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/network_status_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/network_status_contract.rb @@ -26,7 +26,6 @@ class NetworkStatusContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'NetworkStatusContract', type: { @@ -34,13 +33,11 @@ def self.mapper() class_name: 'NetworkStatusContract', model_properties: { dns_servers: { - client_side_validation: true, required: true, serialized_name: 'dnsServers', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -50,13 +47,11 @@ def self.mapper() } }, connectivity_status: { - client_side_validation: true, required: true, serialized_name: 'connectivityStatus', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ConnectivityStatusContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb index 65de73ff5c..694120e29c 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb @@ -25,7 +25,6 @@ class OAuth2AuthenticationSettingsContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OAuth2AuthenticationSettingsContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'OAuth2AuthenticationSettingsContract', model_properties: { authorization_server_id: { - client_side_validation: true, required: false, serialized_name: 'authorizationServerId', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, scope: { - client_side_validation: true, required: false, serialized_name: 'scope', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authorization_server_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authorization_server_contract.rb index 50e6aeda0e..3a32fdbeb5 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authorization_server_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authorization_server_contract.rb @@ -98,7 +98,6 @@ class OAuth2AuthorizationServerContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OAuth2AuthorizationServerContract', type: { @@ -106,7 +105,6 @@ def self.mapper() class_name: 'OAuth2AuthorizationServerContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -115,7 +113,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -127,7 +124,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -135,7 +131,6 @@ def self.mapper() } }, client_registration_endpoint: { - client_side_validation: true, required: true, serialized_name: 'clientRegistrationEndpoint', type: { @@ -143,7 +138,6 @@ def self.mapper() } }, authorization_endpoint: { - client_side_validation: true, required: true, serialized_name: 'authorizationEndpoint', type: { @@ -151,13 +145,11 @@ def self.mapper() } }, authorization_methods: { - client_side_validation: true, required: false, serialized_name: 'authorizationMethods', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'MethodContractElementType', type: { @@ -168,13 +160,11 @@ def self.mapper() } }, client_authentication_method: { - client_side_validation: true, required: false, serialized_name: 'clientAuthenticationMethod', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ClientAuthenticationMethodContractElementType', type: { @@ -185,13 +175,11 @@ def self.mapper() } }, token_body_parameters: { - client_side_validation: true, required: false, serialized_name: 'tokenBodyParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'TokenBodyParameterContractElementType', type: { @@ -202,7 +190,6 @@ def self.mapper() } }, token_endpoint: { - client_side_validation: true, required: false, serialized_name: 'tokenEndpoint', type: { @@ -210,7 +197,6 @@ def self.mapper() } }, support_state: { - client_side_validation: true, required: false, serialized_name: 'supportState', type: { @@ -218,7 +204,6 @@ def self.mapper() } }, default_scope: { - client_side_validation: true, required: false, serialized_name: 'defaultScope', type: { @@ -226,13 +211,11 @@ def self.mapper() } }, grant_types: { - client_side_validation: true, required: true, serialized_name: 'grantTypes', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'GrantTypesContractElementType', type: { @@ -243,13 +226,11 @@ def self.mapper() } }, bearer_token_sending_methods: { - client_side_validation: true, required: false, serialized_name: 'bearerTokenSendingMethods', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'BearerTokenSendingMethodsContractElementType', type: { @@ -260,7 +241,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: true, serialized_name: 'clientId', type: { @@ -268,7 +248,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { @@ -276,7 +255,6 @@ def self.mapper() } }, resource_owner_username: { - client_side_validation: true, required: false, serialized_name: 'resourceOwnerUsername', type: { @@ -284,7 +262,6 @@ def self.mapper() } }, resource_owner_password: { - client_side_validation: true, required: false, serialized_name: 'resourceOwnerPassword', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authorization_server_update_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authorization_server_update_contract.rb index 325a6f06c5..43090f0c96 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authorization_server_update_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/oauth2authorization_server_update_contract.rb @@ -92,7 +92,6 @@ class OAuth2AuthorizationServerUpdateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OAuth2AuthorizationServerUpdateContract', type: { @@ -100,7 +99,6 @@ def self.mapper() class_name: 'OAuth2AuthorizationServerUpdateContract', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -112,7 +110,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -120,7 +117,6 @@ def self.mapper() } }, client_registration_endpoint: { - client_side_validation: true, required: false, serialized_name: 'clientRegistrationEndpoint', type: { @@ -128,7 +124,6 @@ def self.mapper() } }, authorization_endpoint: { - client_side_validation: true, required: false, serialized_name: 'authorizationEndpoint', type: { @@ -136,13 +131,11 @@ def self.mapper() } }, authorization_methods: { - client_side_validation: true, required: false, serialized_name: 'authorizationMethods', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'MethodContractElementType', type: { @@ -153,13 +146,11 @@ def self.mapper() } }, client_authentication_method: { - client_side_validation: true, required: false, serialized_name: 'clientAuthenticationMethod', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ClientAuthenticationMethodContractElementType', type: { @@ -170,13 +161,11 @@ def self.mapper() } }, token_body_parameters: { - client_side_validation: true, required: false, serialized_name: 'tokenBodyParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'TokenBodyParameterContractElementType', type: { @@ -187,7 +176,6 @@ def self.mapper() } }, token_endpoint: { - client_side_validation: true, required: false, serialized_name: 'tokenEndpoint', type: { @@ -195,7 +183,6 @@ def self.mapper() } }, support_state: { - client_side_validation: true, required: false, serialized_name: 'supportState', type: { @@ -203,7 +190,6 @@ def self.mapper() } }, default_scope: { - client_side_validation: true, required: false, serialized_name: 'defaultScope', type: { @@ -211,13 +197,11 @@ def self.mapper() } }, grant_types: { - client_side_validation: true, required: false, serialized_name: 'grantTypes', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'GrantTypesContractElementType', type: { @@ -228,13 +212,11 @@ def self.mapper() } }, bearer_token_sending_methods: { - client_side_validation: true, required: false, serialized_name: 'bearerTokenSendingMethods', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'BearerTokenSendingMethodsContractElementType', type: { @@ -245,7 +227,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: false, serialized_name: 'clientId', type: { @@ -253,7 +234,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { @@ -261,7 +241,6 @@ def self.mapper() } }, resource_owner_username: { - client_side_validation: true, required: false, serialized_name: 'resourceOwnerUsername', type: { @@ -269,7 +248,6 @@ def self.mapper() } }, resource_owner_password: { - client_side_validation: true, required: false, serialized_name: 'resourceOwnerPassword', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb index 6ef9a89b07..714cf2f7af 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OpenIdConnectProviderCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'OpenIdConnectProviderCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'OpenidConnectProviderContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb index 42f79be715..a913fff85e 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb @@ -39,7 +39,6 @@ class OpenidConnectProviderContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OpenidConnectProviderContract', type: { @@ -47,7 +46,6 @@ def self.mapper() class_name: 'OpenidConnectProviderContract', model_properties: { id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { @@ -55,7 +53,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -66,7 +63,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -74,7 +70,6 @@ def self.mapper() } }, metadata_endpoint: { - client_side_validation: true, required: true, serialized_name: 'metadataEndpoint', type: { @@ -82,7 +77,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: true, serialized_name: 'clientId', type: { @@ -90,7 +84,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_create_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_create_contract.rb index 60cbb99015..1c09f4486a 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_create_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_create_contract.rb @@ -36,7 +36,6 @@ class OpenidConnectProviderCreateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OpenidConnectProviderCreateContract', type: { @@ -44,7 +43,6 @@ def self.mapper() class_name: 'OpenidConnectProviderCreateContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -55,7 +53,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -63,7 +60,6 @@ def self.mapper() } }, metadata_endpoint: { - client_side_validation: true, required: true, serialized_name: 'metadataEndpoint', type: { @@ -71,7 +67,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: true, serialized_name: 'clientId', type: { @@ -79,7 +74,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb index 7246456ff3..8d56e7f431 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb @@ -36,7 +36,6 @@ class OpenidConnectProviderUpdateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OpenidConnectProviderUpdateContract', type: { @@ -44,7 +43,6 @@ def self.mapper() class_name: 'OpenidConnectProviderUpdateContract', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -55,7 +53,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -63,7 +60,6 @@ def self.mapper() } }, metadata_endpoint: { - client_side_validation: true, required: false, serialized_name: 'metadataEndpoint', type: { @@ -71,7 +67,6 @@ def self.mapper() } }, client_id: { - client_side_validation: true, required: false, serialized_name: 'clientId', type: { @@ -79,7 +74,6 @@ def self.mapper() } }, client_secret: { - client_side_validation: true, required: false, serialized_name: 'clientSecret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation.rb index ddf594af9f..0b9dd96d75 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation.rb @@ -25,7 +25,6 @@ class Operation # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'Operation', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'Operation', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, display: { - client_side_validation: true, required: false, serialized_name: 'display', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_collection.rb index dee2536ec4..89942587e7 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'OperationCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'OperationContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_contract.rb index d37f1c7dda..4ef579799e 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_contract.rb @@ -37,7 +37,6 @@ class OperationContract < OperationEntityBaseContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationContract', type: { @@ -45,13 +44,11 @@ def self.mapper() class_name: 'OperationContract', model_properties: { template_parameters: { - client_side_validation: true, required: false, serialized_name: 'templateParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ParameterContractElementType', type: { @@ -62,7 +59,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -73,7 +69,6 @@ def self.mapper() } }, request: { - client_side_validation: true, required: false, serialized_name: 'request', type: { @@ -82,13 +77,11 @@ def self.mapper() } }, responses: { - client_side_validation: true, required: false, serialized_name: 'responses', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ResultContractElementType', type: { @@ -99,7 +92,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -108,7 +100,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -120,7 +111,6 @@ def self.mapper() } }, method: { - client_side_validation: true, required: true, serialized_name: 'method', type: { @@ -128,7 +118,6 @@ def self.mapper() } }, url_template: { - client_side_validation: true, required: true, serialized_name: 'urlTemplate', constraints: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_display.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_display.rb index 94d51b5c23..89c14ccee4 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_display.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_display.rb @@ -32,7 +32,6 @@ class OperationDisplay # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'Operation_display', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'OperationDisplay', model_properties: { provider: { - client_side_validation: true, required: false, serialized_name: 'provider', type: { @@ -48,7 +46,6 @@ def self.mapper() } }, operation: { - client_side_validation: true, required: false, serialized_name: 'operation', type: { @@ -56,7 +53,6 @@ def self.mapper() } }, resource: { - client_side_validation: true, required: false, serialized_name: 'resource', type: { @@ -64,7 +60,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_entity_base_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_entity_base_contract.rb index 978af98b7a..bbb117e751 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_entity_base_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_entity_base_contract.rb @@ -33,7 +33,6 @@ class OperationEntityBaseContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationEntityBaseContract', type: { @@ -41,13 +40,11 @@ def self.mapper() class_name: 'OperationEntityBaseContract', model_properties: { template_parameters: { - client_side_validation: true, required: false, serialized_name: 'templateParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ParameterContractElementType', type: { @@ -58,7 +55,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -69,7 +65,6 @@ def self.mapper() } }, request: { - client_side_validation: true, required: false, serialized_name: 'request', type: { @@ -78,13 +73,11 @@ def self.mapper() } }, responses: { - client_side_validation: true, required: false, serialized_name: 'responses', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ResultContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_list_result.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_list_result.rb index 9077ae0e13..45f25869fa 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_list_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_list_result.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationListResult', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'OperationListResult', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'OperationElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_result_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_result_contract.rb index 9603a4f20a..cc6c7ebcf5 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_result_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_result_contract.rb @@ -44,7 +44,6 @@ class OperationResultContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationResultContract', type: { @@ -52,7 +51,6 @@ def self.mapper() class_name: 'OperationResultContract', model_properties: { id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { @@ -60,7 +58,6 @@ def self.mapper() } }, status: { - client_side_validation: true, required: false, serialized_name: 'status', type: { @@ -69,7 +66,6 @@ def self.mapper() } }, started: { - client_side_validation: true, required: false, serialized_name: 'started', type: { @@ -77,7 +73,6 @@ def self.mapper() } }, updated: { - client_side_validation: true, required: false, serialized_name: 'updated', type: { @@ -85,7 +80,6 @@ def self.mapper() } }, result_info: { - client_side_validation: true, required: false, serialized_name: 'resultInfo', type: { @@ -93,7 +87,6 @@ def self.mapper() } }, error: { - client_side_validation: true, required: false, serialized_name: 'error', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_update_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_update_contract.rb index aaad5651f2..17bd89bca6 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_update_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/operation_update_contract.rb @@ -37,7 +37,6 @@ class OperationUpdateContract < OperationEntityBaseContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'OperationUpdateContract', type: { @@ -45,13 +44,11 @@ def self.mapper() class_name: 'OperationUpdateContract', model_properties: { template_parameters: { - client_side_validation: true, required: false, serialized_name: 'templateParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ParameterContractElementType', type: { @@ -62,7 +59,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -73,7 +69,6 @@ def self.mapper() } }, request: { - client_side_validation: true, required: false, serialized_name: 'request', type: { @@ -82,13 +77,11 @@ def self.mapper() } }, responses: { - client_side_validation: true, required: false, serialized_name: 'responses', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ResultContractElementType', type: { @@ -99,7 +92,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -108,7 +100,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -120,7 +111,6 @@ def self.mapper() } }, method: { - client_side_validation: true, required: false, serialized_name: 'method', type: { @@ -128,7 +118,6 @@ def self.mapper() } }, url_template: { - client_side_validation: true, required: false, serialized_name: 'urlTemplate', constraints: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/parameter_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/parameter_contract.rb index 04cd6fe8ba..d81326788e 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/parameter_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/parameter_contract.rb @@ -37,7 +37,6 @@ class ParameterContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ParameterContract', type: { @@ -45,7 +44,6 @@ def self.mapper() class_name: 'ParameterContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { @@ -53,7 +51,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -61,7 +58,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: true, serialized_name: 'type', type: { @@ -69,7 +65,6 @@ def self.mapper() } }, default_value: { - client_side_validation: true, required: false, serialized_name: 'defaultValue', type: { @@ -77,7 +72,6 @@ def self.mapper() } }, required: { - client_side_validation: true, required: false, serialized_name: 'required', type: { @@ -85,13 +79,11 @@ def self.mapper() } }, values: { - client_side_validation: true, required: false, serialized_name: 'values', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb index 2836c3f8b4..aa82aa08b6 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb @@ -32,7 +32,6 @@ class PolicySnippetContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PolicySnippetContract', type: { @@ -40,7 +39,6 @@ def self.mapper() class_name: 'PolicySnippetContract', model_properties: { name: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'name', @@ -49,7 +47,6 @@ def self.mapper() } }, content: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'content', @@ -58,7 +55,6 @@ def self.mapper() } }, tool_tip: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'toolTip', @@ -67,7 +63,6 @@ def self.mapper() } }, scope: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'scope', diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/policy_snippets_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/policy_snippets_collection.rb index 2923aa01c3..3494b98c47 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/policy_snippets_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/policy_snippets_collection.rb @@ -22,7 +22,6 @@ class PolicySnippetsCollection # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PolicySnippetsCollection', type: { @@ -30,13 +29,11 @@ def self.mapper() class_name: 'PolicySnippetsCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'PolicySnippetContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_collection.rb index 861912cdb6..acbf00f4f4 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ProductCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'ProductCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ProductContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_contract.rb index bb6744e23e..cf0086ced4 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_contract.rb @@ -67,7 +67,6 @@ class ProductContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ProductContract', type: { @@ -75,7 +74,6 @@ def self.mapper() class_name: 'ProductContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -84,7 +82,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -96,7 +93,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -108,7 +104,6 @@ def self.mapper() } }, terms: { - client_side_validation: true, required: false, serialized_name: 'terms', type: { @@ -116,7 +111,6 @@ def self.mapper() } }, subscription_required: { - client_side_validation: true, required: false, serialized_name: 'subscriptionRequired', default_value: true, @@ -125,7 +119,6 @@ def self.mapper() } }, approval_required: { - client_side_validation: true, required: false, serialized_name: 'approvalRequired', type: { @@ -133,7 +126,6 @@ def self.mapper() } }, subscriptions_limit: { - client_side_validation: true, required: false, serialized_name: 'subscriptionsLimit', type: { @@ -141,7 +133,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', default_value: 'NotPublished', diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_update_parameters.rb index fc446bdece..86824e8237 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/product_update_parameters.rb @@ -58,7 +58,6 @@ class ProductUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ProductUpdateParameters', type: { @@ -66,7 +65,6 @@ def self.mapper() class_name: 'ProductUpdateParameters', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -78,7 +76,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', constraints: { @@ -90,7 +87,6 @@ def self.mapper() } }, terms: { - client_side_validation: true, required: false, serialized_name: 'terms', type: { @@ -98,7 +94,6 @@ def self.mapper() } }, subscription_required: { - client_side_validation: true, required: false, serialized_name: 'subscriptionRequired', type: { @@ -106,7 +101,6 @@ def self.mapper() } }, approval_required: { - client_side_validation: true, required: false, serialized_name: 'approvalRequired', type: { @@ -114,7 +108,6 @@ def self.mapper() } }, subscriptions_limit: { - client_side_validation: true, required: false, serialized_name: 'subscriptionsLimit', type: { @@ -122,7 +115,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_collection.rb index 5baf397766..7861f1f413 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PropertyCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'PropertyCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'PropertyContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_contract.rb index 0f161d0a0f..c1141fb3ca 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_contract.rb @@ -41,7 +41,6 @@ class PropertyContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PropertyContract', type: { @@ -49,7 +48,6 @@ def self.mapper() class_name: 'PropertyContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -58,7 +56,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -71,7 +68,6 @@ def self.mapper() } }, value: { - client_side_validation: true, required: true, serialized_name: 'value', constraints: { @@ -83,7 +79,6 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', constraints: { @@ -92,7 +87,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -102,7 +96,6 @@ def self.mapper() } }, secret: { - client_side_validation: true, required: false, serialized_name: 'secret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_create_parameters.rb index 60153975bc..28af2e8b74 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_create_parameters.rb @@ -35,7 +35,6 @@ class PropertyCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PropertyCreateParameters', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'PropertyCreateParameters', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -56,7 +54,6 @@ def self.mapper() } }, value: { - client_side_validation: true, required: true, serialized_name: 'value', constraints: { @@ -68,7 +65,6 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', constraints: { @@ -77,7 +73,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -87,7 +82,6 @@ def self.mapper() } }, secret: { - client_side_validation: true, required: false, serialized_name: 'secret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_update_parameters.rb index 2ed7dfd3e6..66c7138ec7 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/property_update_parameters.rb @@ -35,7 +35,6 @@ class PropertyUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'PropertyUpdateParameters', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'PropertyUpdateParameters', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -56,7 +54,6 @@ def self.mapper() } }, value: { - client_side_validation: true, required: false, serialized_name: 'value', constraints: { @@ -68,7 +65,6 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', constraints: { @@ -77,7 +73,6 @@ def self.mapper() type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { @@ -87,7 +82,6 @@ def self.mapper() } }, secret: { - client_side_validation: true, required: false, serialized_name: 'secret', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_collection.rb index bf1ef2a818..14f48b77f0 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_collection.rb @@ -28,7 +28,6 @@ class QuotaCounterCollection # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'QuotaCounterCollection', type: { @@ -36,13 +35,11 @@ def self.mapper() class_name: 'QuotaCounterCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'QuotaCounterContractElementType', type: { @@ -53,7 +50,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -61,7 +57,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_contract.rb index 66b34a38d0..c2f220105a 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_contract.rb @@ -38,7 +38,6 @@ class QuotaCounterContract < QuotaCounterValueContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'QuotaCounterContract', type: { @@ -46,7 +45,6 @@ def self.mapper() class_name: 'QuotaCounterContract', model_properties: { calls_count: { - client_side_validation: true, required: false, serialized_name: 'callsCount', type: { @@ -54,7 +52,6 @@ def self.mapper() } }, kb_transferred: { - client_side_validation: true, required: false, serialized_name: 'kbTransferred', type: { @@ -62,7 +59,6 @@ def self.mapper() } }, counter_key: { - client_side_validation: true, required: true, serialized_name: 'counterKey', constraints: { @@ -73,7 +69,6 @@ def self.mapper() } }, period_key: { - client_side_validation: true, required: true, serialized_name: 'periodKey', constraints: { @@ -84,7 +79,6 @@ def self.mapper() } }, period_start_time: { - client_side_validation: true, required: true, serialized_name: 'periodStartTime', type: { @@ -92,7 +86,6 @@ def self.mapper() } }, period_end_time: { - client_side_validation: true, required: true, serialized_name: 'periodEndTime', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb index 7d623615b2..f8fbcfd706 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb @@ -25,7 +25,6 @@ class QuotaCounterValueContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'QuotaCounterValueContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'QuotaCounterValueContract', model_properties: { calls_count: { - client_side_validation: true, required: false, serialized_name: 'callsCount', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, kb_transferred: { - client_side_validation: true, required: false, serialized_name: 'kbTransferred', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/region_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/region_contract.rb index c2a01459ab..35f8d288d7 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/region_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/region_contract.rb @@ -25,7 +25,6 @@ class RegionContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'RegionContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'RegionContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, is_master_region: { - client_side_validation: true, required: true, serialized_name: 'isMasterRegion', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/region_list_result.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/region_list_result.rb index c9d9124731..e822c0d74d 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/region_list_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/region_list_result.rb @@ -22,7 +22,6 @@ class RegionListResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'RegionListResult', type: { @@ -30,13 +29,11 @@ def self.mapper() class_name: 'RegionListResult', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'RegionContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/report_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/report_collection.rb index 80368809e1..8ab1328d20 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/report_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/report_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ReportCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'ReportCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ReportRecordContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/report_record_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/report_record_contract.rb index ffb50beeea..29eae9ab96 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/report_record_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/report_record_contract.rb @@ -110,7 +110,6 @@ class ReportRecordContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ReportRecordContract', type: { @@ -118,7 +117,6 @@ def self.mapper() class_name: 'ReportRecordContract', model_properties: { name: { - client_side_validation: true, required: false, serialized_name: 'name', type: { @@ -126,7 +124,6 @@ def self.mapper() } }, timestamp: { - client_side_validation: true, required: false, serialized_name: 'timestamp', type: { @@ -134,7 +131,6 @@ def self.mapper() } }, interval: { - client_side_validation: true, required: false, serialized_name: 'interval', type: { @@ -142,7 +138,6 @@ def self.mapper() } }, country: { - client_side_validation: true, required: false, serialized_name: 'country', type: { @@ -150,7 +145,6 @@ def self.mapper() } }, region: { - client_side_validation: true, required: false, serialized_name: 'region', type: { @@ -158,7 +152,6 @@ def self.mapper() } }, zip: { - client_side_validation: true, required: false, serialized_name: 'zip', type: { @@ -166,7 +159,6 @@ def self.mapper() } }, user_id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'userId', @@ -175,7 +167,6 @@ def self.mapper() } }, product_id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'productId', @@ -184,7 +175,6 @@ def self.mapper() } }, api_id: { - client_side_validation: true, required: false, serialized_name: 'apiId', type: { @@ -192,7 +182,6 @@ def self.mapper() } }, operation_id: { - client_side_validation: true, required: false, serialized_name: 'operationId', type: { @@ -200,7 +189,6 @@ def self.mapper() } }, api_region: { - client_side_validation: true, required: false, serialized_name: 'apiRegion', type: { @@ -208,7 +196,6 @@ def self.mapper() } }, subscription_id: { - client_side_validation: true, required: false, serialized_name: 'subscriptionId', type: { @@ -216,7 +203,6 @@ def self.mapper() } }, call_count_success: { - client_side_validation: true, required: false, serialized_name: 'callCountSuccess', type: { @@ -224,7 +210,6 @@ def self.mapper() } }, call_count_blocked: { - client_side_validation: true, required: false, serialized_name: 'callCountBlocked', type: { @@ -232,7 +217,6 @@ def self.mapper() } }, call_count_failed: { - client_side_validation: true, required: false, serialized_name: 'callCountFailed', type: { @@ -240,7 +224,6 @@ def self.mapper() } }, call_count_other: { - client_side_validation: true, required: false, serialized_name: 'callCountOther', type: { @@ -248,7 +231,6 @@ def self.mapper() } }, call_count_total: { - client_side_validation: true, required: false, serialized_name: 'callCountTotal', type: { @@ -256,7 +238,6 @@ def self.mapper() } }, bandwidth: { - client_side_validation: true, required: false, serialized_name: 'bandwidth', type: { @@ -264,7 +245,6 @@ def self.mapper() } }, cache_hit_count: { - client_side_validation: true, required: false, serialized_name: 'cacheHitCount', type: { @@ -272,7 +252,6 @@ def self.mapper() } }, cache_miss_count: { - client_side_validation: true, required: false, serialized_name: 'cacheMissCount', type: { @@ -280,7 +259,6 @@ def self.mapper() } }, api_time_avg: { - client_side_validation: true, required: false, serialized_name: 'apiTimeAvg', type: { @@ -288,7 +266,6 @@ def self.mapper() } }, api_time_min: { - client_side_validation: true, required: false, serialized_name: 'apiTimeMin', type: { @@ -296,7 +273,6 @@ def self.mapper() } }, api_time_max: { - client_side_validation: true, required: false, serialized_name: 'apiTimeMax', type: { @@ -304,7 +280,6 @@ def self.mapper() } }, service_time_avg: { - client_side_validation: true, required: false, serialized_name: 'serviceTimeAvg', type: { @@ -312,7 +287,6 @@ def self.mapper() } }, service_time_min: { - client_side_validation: true, required: false, serialized_name: 'serviceTimeMin', type: { @@ -320,7 +294,6 @@ def self.mapper() } }, service_time_max: { - client_side_validation: true, required: false, serialized_name: 'serviceTimeMax', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/representation_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/representation_contract.rb index 70eb452ab0..657ee5df30 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/representation_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/representation_contract.rb @@ -26,7 +26,6 @@ class RepresentationContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'RepresentationContract', type: { @@ -34,7 +33,6 @@ def self.mapper() class_name: 'RepresentationContract', model_properties: { content_type: { - client_side_validation: true, required: true, serialized_name: 'contentType', type: { @@ -42,7 +40,6 @@ def self.mapper() } }, sample: { - client_side_validation: true, required: false, serialized_name: 'sample', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/request_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/request_contract.rb index 89fc1f1e51..862b827b62 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/request_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/request_contract.rb @@ -34,7 +34,6 @@ class RequestContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'RequestContract', type: { @@ -42,7 +41,6 @@ def self.mapper() class_name: 'RequestContract', model_properties: { description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -50,13 +48,11 @@ def self.mapper() } }, query_parameters: { - client_side_validation: true, required: false, serialized_name: 'queryParameters', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ParameterContractElementType', type: { @@ -67,13 +63,11 @@ def self.mapper() } }, headers: { - client_side_validation: true, required: false, serialized_name: 'headers', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'ParameterContractElementType', type: { @@ -84,13 +78,11 @@ def self.mapper() } }, representations: { - client_side_validation: true, required: false, serialized_name: 'representations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'RepresentationContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/resource.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/resource.rb index 3c133d6c99..649edb1f41 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/resource.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/resource.rb @@ -35,7 +35,6 @@ class Resource # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'Resource', type: { @@ -43,7 +42,6 @@ def self.mapper() class_name: 'Resource', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -52,7 +50,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, serialized_name: 'name', type: { @@ -60,7 +57,6 @@ def self.mapper() } }, type: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'type', @@ -69,7 +65,6 @@ def self.mapper() } }, location: { - client_side_validation: true, required: true, serialized_name: 'location', type: { @@ -77,13 +72,11 @@ def self.mapper() } }, tags: { - client_side_validation: true, required: false, serialized_name: 'tags', type: { name: 'Dictionary', value: { - client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/result_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/result_contract.rb index 46a1654ca2..38fe4bbbf8 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/result_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/result_contract.rb @@ -29,7 +29,6 @@ class ResultContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'ResultContract', type: { @@ -37,7 +36,6 @@ def self.mapper() class_name: 'ResultContract', model_properties: { status_code: { - client_side_validation: true, required: true, serialized_name: 'statusCode', constraints: { @@ -49,7 +47,6 @@ def self.mapper() } }, description: { - client_side_validation: true, required: false, serialized_name: 'description', type: { @@ -57,13 +54,11 @@ def self.mapper() } }, representations: { - client_side_validation: true, required: false, serialized_name: 'representations', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'RepresentationContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb index bf0113e09d..e19802930e 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb @@ -28,7 +28,6 @@ class SaveConfigurationParameter # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SaveConfigurationParameter', type: { @@ -36,7 +35,6 @@ def self.mapper() class_name: 'SaveConfigurationParameter', model_properties: { branch: { - client_side_validation: true, required: true, serialized_name: 'branch', type: { @@ -44,7 +42,6 @@ def self.mapper() } }, force: { - client_side_validation: true, required: false, serialized_name: 'force', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_collection.rb index cd7c1ee4aa..7d96639f51 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'SubscriptionCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'SubscriptionContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_contract.rb index ad79f37456..29226a0260 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_contract.rb @@ -91,7 +91,6 @@ class SubscriptionContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionContract', type: { @@ -99,7 +98,6 @@ def self.mapper() class_name: 'SubscriptionContract', model_properties: { id: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'id', @@ -108,7 +106,6 @@ def self.mapper() } }, user_id: { - client_side_validation: true, required: false, serialized_name: 'userId', type: { @@ -116,7 +113,6 @@ def self.mapper() } }, product_id: { - client_side_validation: true, required: false, serialized_name: 'productId', type: { @@ -124,7 +120,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, serialized_name: 'name', constraints: { @@ -136,7 +131,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { @@ -145,7 +139,6 @@ def self.mapper() } }, created_date: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'createdDate', @@ -154,7 +147,6 @@ def self.mapper() } }, start_date: { - client_side_validation: true, required: false, serialized_name: 'startDate', type: { @@ -162,7 +154,6 @@ def self.mapper() } }, expiration_date: { - client_side_validation: true, required: false, serialized_name: 'expirationDate', type: { @@ -170,7 +161,6 @@ def self.mapper() } }, end_date: { - client_side_validation: true, required: false, serialized_name: 'endDate', type: { @@ -178,7 +168,6 @@ def self.mapper() } }, notification_date: { - client_side_validation: true, required: false, serialized_name: 'notificationDate', type: { @@ -186,7 +175,6 @@ def self.mapper() } }, primary_key: { - client_side_validation: true, required: false, serialized_name: 'primaryKey', constraints: { @@ -198,7 +186,6 @@ def self.mapper() } }, secondary_key: { - client_side_validation: true, required: false, serialized_name: 'secondaryKey', constraints: { @@ -210,7 +197,6 @@ def self.mapper() } }, state_comment: { - client_side_validation: true, required: false, serialized_name: 'stateComment', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb index 483f14b7da..51725fff82 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb @@ -51,7 +51,6 @@ class SubscriptionCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionCreateParameters', type: { @@ -59,7 +58,6 @@ def self.mapper() class_name: 'SubscriptionCreateParameters', model_properties: { user_id: { - client_side_validation: true, required: true, serialized_name: 'userId', type: { @@ -67,7 +65,6 @@ def self.mapper() } }, product_id: { - client_side_validation: true, required: true, serialized_name: 'productId', type: { @@ -75,7 +72,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: true, serialized_name: 'name', constraints: { @@ -87,7 +83,6 @@ def self.mapper() } }, primary_key: { - client_side_validation: true, required: false, serialized_name: 'primaryKey', constraints: { @@ -99,7 +94,6 @@ def self.mapper() } }, secondary_key: { - client_side_validation: true, required: false, serialized_name: 'secondaryKey', constraints: { @@ -111,7 +105,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb index 19369231fa..1b9e8c3ec2 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb @@ -25,7 +25,6 @@ class SubscriptionKeyParameterNamesContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionKeyParameterNamesContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'SubscriptionKeyParameterNamesContract', model_properties: { header: { - client_side_validation: true, required: false, serialized_name: 'header', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, query: { - client_side_validation: true, required: false, serialized_name: 'query', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb index 46a29f3e08..b963321d24 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb @@ -53,7 +53,6 @@ class SubscriptionUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'SubscriptionUpdateParameters', type: { @@ -61,7 +60,6 @@ def self.mapper() class_name: 'SubscriptionUpdateParameters', model_properties: { user_id: { - client_side_validation: true, required: false, serialized_name: 'userId', type: { @@ -69,7 +67,6 @@ def self.mapper() } }, product_id: { - client_side_validation: true, required: false, serialized_name: 'productId', type: { @@ -77,7 +74,6 @@ def self.mapper() } }, expiration_date: { - client_side_validation: true, required: false, serialized_name: 'expirationDate', type: { @@ -85,7 +81,6 @@ def self.mapper() } }, name: { - client_side_validation: true, required: false, serialized_name: 'name', type: { @@ -93,7 +88,6 @@ def self.mapper() } }, primary_key: { - client_side_validation: true, required: false, serialized_name: 'primaryKey', constraints: { @@ -105,7 +99,6 @@ def self.mapper() } }, secondary_key: { - client_side_validation: true, required: false, serialized_name: 'secondaryKey', constraints: { @@ -117,7 +110,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { @@ -126,7 +118,6 @@ def self.mapper() } }, state_comment: { - client_side_validation: true, required: false, serialized_name: 'stateComment', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb index 5a09d23a78..944426c6a0 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb @@ -49,7 +49,6 @@ class TenantConfigurationSyncStateContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'TenantConfigurationSyncStateContract', type: { @@ -57,7 +56,6 @@ def self.mapper() class_name: 'TenantConfigurationSyncStateContract', model_properties: { branch: { - client_side_validation: true, required: false, serialized_name: 'branch', type: { @@ -65,7 +63,6 @@ def self.mapper() } }, commit_id: { - client_side_validation: true, required: false, serialized_name: 'commitId', type: { @@ -73,7 +70,6 @@ def self.mapper() } }, is_export: { - client_side_validation: true, required: false, serialized_name: 'isExport', type: { @@ -81,7 +77,6 @@ def self.mapper() } }, is_synced: { - client_side_validation: true, required: false, serialized_name: 'isSynced', type: { @@ -89,7 +84,6 @@ def self.mapper() } }, is_git_enabled: { - client_side_validation: true, required: false, serialized_name: 'isGitEnabled', type: { @@ -97,7 +91,6 @@ def self.mapper() } }, sync_date: { - client_side_validation: true, required: false, serialized_name: 'syncDate', type: { @@ -105,7 +98,6 @@ def self.mapper() } }, configuration_change_date: { - client_side_validation: true, required: false, serialized_name: 'configurationChangeDate', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb index 318f3b4a4f..d0c9436475 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb @@ -25,7 +25,6 @@ class TokenBodyParameterContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'TokenBodyParameterContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'TokenBodyParameterContract', model_properties: { name: { - client_side_validation: true, required: true, serialized_name: 'name', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, value: { - client_side_validation: true, required: true, serialized_name: 'value', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_collection.rb index b066255f38..5e4a04d71d 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_collection.rb @@ -60,7 +60,6 @@ def get_next_page # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserCollection', type: { @@ -68,13 +67,11 @@ def self.mapper() class_name: 'UserCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'UserContractElementType', type: { @@ -85,7 +82,6 @@ def self.mapper() } }, count: { - client_side_validation: true, required: false, serialized_name: 'count', type: { @@ -93,7 +89,6 @@ def self.mapper() } }, next_link: { - client_side_validation: true, required: false, serialized_name: 'nextLink', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_contract.rb index f82f459b7c..8338db9327 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_contract.rb @@ -47,7 +47,6 @@ class UserContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserContract', type: { @@ -55,7 +54,6 @@ def self.mapper() class_name: 'UserContract', model_properties: { id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { @@ -63,7 +61,6 @@ def self.mapper() } }, first_name: { - client_side_validation: true, required: false, serialized_name: 'firstName', type: { @@ -71,7 +68,6 @@ def self.mapper() } }, last_name: { - client_side_validation: true, required: false, serialized_name: 'lastName', type: { @@ -79,7 +75,6 @@ def self.mapper() } }, email: { - client_side_validation: true, required: false, serialized_name: 'email', type: { @@ -87,7 +82,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { @@ -96,7 +90,6 @@ def self.mapper() } }, registration_date: { - client_side_validation: true, required: false, serialized_name: 'registrationDate', type: { @@ -104,7 +97,6 @@ def self.mapper() } }, note: { - client_side_validation: true, required: false, serialized_name: 'note', type: { @@ -112,14 +104,12 @@ def self.mapper() } }, identities: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'identities', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'UserIdentityContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_create_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_create_parameters.rb index 64c75a6182..0cf8f586c0 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_create_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_create_parameters.rb @@ -42,7 +42,6 @@ class UserCreateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserCreateParameters', type: { @@ -50,7 +49,6 @@ def self.mapper() class_name: 'UserCreateParameters', model_properties: { email: { - client_side_validation: true, required: true, serialized_name: 'email', constraints: { @@ -62,7 +60,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: true, serialized_name: 'password', type: { @@ -70,7 +67,6 @@ def self.mapper() } }, first_name: { - client_side_validation: true, required: true, serialized_name: 'firstName', constraints: { @@ -82,7 +78,6 @@ def self.mapper() } }, last_name: { - client_side_validation: true, required: true, serialized_name: 'lastName', constraints: { @@ -94,7 +89,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', default_value: 'Active', @@ -104,7 +98,6 @@ def self.mapper() } }, note: { - client_side_validation: true, required: false, serialized_name: 'note', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_identity_collection.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_identity_collection.rb index 61d2cc1fc4..44733961ab 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_identity_collection.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_identity_collection.rb @@ -22,7 +22,6 @@ class UserIdentityCollection # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserIdentityCollection', type: { @@ -30,13 +29,11 @@ def self.mapper() class_name: 'UserIdentityCollection', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { - client_side_validation: true, required: false, serialized_name: 'UserIdentityContractElementType', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_identity_contract.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_identity_contract.rb index b56fa43ea8..5690a80ecd 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_identity_contract.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_identity_contract.rb @@ -25,7 +25,6 @@ class UserIdentityContract # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserIdentityContract', type: { @@ -33,7 +32,6 @@ def self.mapper() class_name: 'UserIdentityContract', model_properties: { provider: { - client_side_validation: true, required: false, serialized_name: 'provider', type: { @@ -41,7 +39,6 @@ def self.mapper() } }, id: { - client_side_validation: true, required: false, serialized_name: 'id', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_token_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_token_parameters.rb index dba0db0e27..2857fdc20c 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_token_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_token_parameters.rb @@ -30,7 +30,6 @@ class UserTokenParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserTokenParameters', type: { @@ -38,7 +37,6 @@ def self.mapper() class_name: 'UserTokenParameters', model_properties: { key_type: { - client_side_validation: true, required: true, serialized_name: 'keyType', default_value: 'primary', @@ -48,7 +46,6 @@ def self.mapper() } }, expiry: { - client_side_validation: true, required: true, serialized_name: 'expiry', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_token_result.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_token_result.rb index 1daf73d071..b72fce9aef 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_token_result.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_token_result.rb @@ -22,7 +22,6 @@ class UserTokenResult # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserTokenResult', type: { @@ -30,7 +29,6 @@ def self.mapper() class_name: 'UserTokenResult', model_properties: { value: { - client_side_validation: true, required: false, serialized_name: 'value', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_update_parameters.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_update_parameters.rb index a418874e7c..337b3155d4 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_update_parameters.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/user_update_parameters.rb @@ -38,7 +38,6 @@ class UserUpdateParameters # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'UserUpdateParameters', type: { @@ -46,7 +45,6 @@ def self.mapper() class_name: 'UserUpdateParameters', model_properties: { email: { - client_side_validation: true, required: false, serialized_name: 'email', type: { @@ -54,7 +52,6 @@ def self.mapper() } }, password: { - client_side_validation: true, required: false, serialized_name: 'password', type: { @@ -62,7 +59,6 @@ def self.mapper() } }, first_name: { - client_side_validation: true, required: false, serialized_name: 'firstName', constraints: { @@ -74,7 +70,6 @@ def self.mapper() } }, last_name: { - client_side_validation: true, required: false, serialized_name: 'lastName', constraints: { @@ -86,7 +81,6 @@ def self.mapper() } }, state: { - client_side_validation: true, required: false, serialized_name: 'state', type: { @@ -95,7 +89,6 @@ def self.mapper() } }, note: { - client_side_validation: true, required: false, serialized_name: 'note', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb index 4b969e30fe..dbf3a8842d 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb @@ -34,7 +34,6 @@ class VirtualNetworkConfiguration # def self.mapper() { - client_side_validation: true, required: false, serialized_name: 'VirtualNetworkConfiguration', type: { @@ -42,7 +41,6 @@ def self.mapper() class_name: 'VirtualNetworkConfiguration', model_properties: { vnetid: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'vnetid', @@ -51,7 +49,6 @@ def self.mapper() } }, subnetname: { - client_side_validation: true, required: false, read_only: true, serialized_name: 'subnetname', @@ -60,7 +57,6 @@ def self.mapper() } }, subnet_resource_id: { - client_side_validation: true, required: false, serialized_name: 'subnetResourceId', constraints: { @@ -71,7 +67,6 @@ def self.mapper() } }, location: { - client_side_validation: true, required: false, serialized_name: 'location', type: { diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/network_status.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/network_status.rb index 04e0bf8efd..85ba5f74be 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/network_status.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/network_status.rb @@ -33,8 +33,8 @@ def initialize(client) # # @return [NetworkStatusContract] operation results. # - def get_by_service(resource_group_name, service_name, custom_headers:nil) - response = get_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_by_service(resource_group_name, service_name, custom_headers = nil) + response = get_by_service_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -50,8 +50,8 @@ def get_by_service(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_by_service_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_by_service_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_by_service_async(resource_group_name, service_name, custom_headers).value! end # @@ -66,18 +66,14 @@ def get_by_service_with_http_info(resource_group_name, service_name, custom_head # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_by_service_async(resource_group_name, service_name, custom_headers:nil) + def get_by_service_async(resource_group_name, service_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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[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 diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/open_id_connect_providers.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/open_id_connect_providers.rb index af50dbf535..980ca68b67 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/open_id_connect_providers.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/open_id_connect_providers.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -87,20 +87,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -156,8 +150,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [OpenidConnectProviderContract] operation results. # - def get(resource_group_name, service_name, opid, custom_headers:nil) - response = get_async(resource_group_name, service_name, opid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, opid, custom_headers = nil) + response = get_async(resource_group_name, service_name, opid, custom_headers).value! response.body unless response.nil? end @@ -172,8 +166,8 @@ def get(resource_group_name, service_name, opid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, opid, custom_headers:nil) - get_async(resource_group_name, service_name, opid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, opid, custom_headers = nil) + get_async(resource_group_name, service_name, opid, custom_headers).value! end # @@ -187,21 +181,15 @@ def get_with_http_info(resource_group_name, service_name, opid, custom_headers:n # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, opid, custom_headers:nil) + def get_async(resource_group_name, service_name, opid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'opid is nil' if opid.nil? - fail ArgumentError, "'opid' should satisfy the constraint - 'MaxLength': '256'" if !opid.nil? && opid.length > 256 - fail ArgumentError, "'opid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !opid.nil? && opid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -257,8 +245,8 @@ def get_async(resource_group_name, service_name, opid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, opid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, opid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers).value! nil end @@ -274,8 +262,8 @@ def create_or_update(resource_group_name, service_name, opid, parameters, custom # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, opid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, opid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers).value! end # @@ -290,27 +278,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, opid, par # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, opid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'opid is nil' if opid.nil? - fail ArgumentError, "'opid' should satisfy the constraint - 'MaxLength': '256'" if !opid.nil? && opid.length > 256 - fail ArgumentError, "'opid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !opid.nil? && opid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::OpenidConnectProviderCreateContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -361,8 +345,8 @@ def create_or_update_async(resource_group_name, service_name, opid, parameters, # will be added to the HTTP request. # # - def update(resource_group_name, service_name, opid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers).value! nil end @@ -381,8 +365,8 @@ def update(resource_group_name, service_name, opid, parameters, if_match, custom # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, opid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers).value! end # @@ -400,15 +384,10 @@ def update_with_http_info(resource_group_name, service_name, opid, parameters, i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'opid is nil' if opid.nil? - fail ArgumentError, "'opid' should satisfy the constraint - 'MaxLength': '256'" if !opid.nil? && opid.length > 256 - fail ArgumentError, "'opid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !opid.nil? && opid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -416,13 +395,14 @@ def update_async(resource_group_name, service_name, opid, parameters, if_match, request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::OpenidConnectProviderUpdateContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -474,8 +454,8 @@ def update_async(resource_group_name, service_name, opid, parameters, if_match, # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, opid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, opid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, opid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, opid, if_match, custom_headers).value! response.body unless response.nil? end @@ -494,8 +474,8 @@ def delete(resource_group_name, service_name, opid, if_match, custom_headers:nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, opid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, opid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, opid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, opid, if_match, custom_headers).value! end # @@ -513,22 +493,16 @@ def delete_with_http_info(resource_group_name, service_name, opid, if_match, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, opid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, opid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'opid is nil' if opid.nil? - fail ArgumentError, "'opid' should satisfy the constraint - 'MaxLength': '256'" if !opid.nil? && opid.length > 256 - fail ArgumentError, "'opid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !opid.nil? && opid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -584,8 +558,8 @@ def delete_async(resource_group_name, service_name, opid, if_match, custom_heade # # @return [OpenIdConnectProviderCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -599,8 +573,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -613,12 +587,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -682,12 +655,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [OpenIdConnectProviderCollection] which provide lazy access to pages # of the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/policy_snippets.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/policy_snippets.rb index f5ec88b6ba..e2d7bafd28 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/policy_snippets.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/policy_snippets.rb @@ -33,8 +33,8 @@ def initialize(client) # # @return [PolicySnippetsCollection] operation results. # - def list_by_service(resource_group_name, service_name, scope:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, scope:scope, custom_headers:custom_headers).value! + def list_by_service(resource_group_name, service_name, scope = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, scope, custom_headers).value! response.body unless response.nil? end @@ -50,8 +50,8 @@ def list_by_service(resource_group_name, service_name, scope:nil, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, scope:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, scope:scope, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, scope = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, scope, custom_headers).value! end # @@ -66,18 +66,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, scope:nil, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, scope:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, scope = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_apis.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_apis.rb index 630e83f4f0..93af689fdb 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_apis.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_apis.rb @@ -49,8 +49,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_products(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_products_as_lazy(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_products(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_products_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -82,8 +82,8 @@ def list_by_products(resource_group_name, service_name, product_id, filter:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_products_with_http_info(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_products_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_products_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_products_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! end # @@ -114,24 +114,15 @@ def list_by_products_with_http_info(resource_group_name, service_name, product_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_products_async(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_products_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -189,8 +180,8 @@ def list_by_products_async(resource_group_name, service_name, product_id, filter # will be added to the HTTP request. # # - def create(resource_group_name, service_name, product_id, api_id, custom_headers:nil) - response = create_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! + def create(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + response = create_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! nil end @@ -208,8 +199,8 @@ def create(resource_group_name, service_name, product_id, api_id, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers:nil) - create_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! + def create_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + create_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! end # @@ -226,26 +217,16 @@ def create_with_http_info(resource_group_name, service_name, product_id, api_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_async(resource_group_name, service_name, product_id, api_id, custom_headers:nil) + def create_async(resource_group_name, service_name, product_id, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -293,8 +274,8 @@ def create_async(resource_group_name, service_name, product_id, api_id, custom_h # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, product_id, api_id, custom_headers:nil) - response = delete_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! nil end @@ -312,8 +293,8 @@ def delete(resource_group_name, service_name, product_id, api_id, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers:nil) - delete_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! end # @@ -330,26 +311,16 @@ def delete_with_http_info(resource_group_name, service_name, product_id, api_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, product_id, api_id, custom_headers:nil) + def delete_async(resource_group_name, service_name, product_id, api_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'api_id is nil' if api_id.nil? - fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256 - fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1 - fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -394,8 +365,8 @@ def delete_async(resource_group_name, service_name, product_id, api_id, custom_h # # @return [ApiCollection] operation results. # - def list_by_products_next(next_page_link, custom_headers:nil) - response = list_by_products_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_products_next(next_page_link, custom_headers = nil) + response = list_by_products_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -409,8 +380,8 @@ def list_by_products_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_products_next_with_http_info(next_page_link, custom_headers:nil) - list_by_products_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_products_next_with_http_info(next_page_link, custom_headers = nil) + list_by_products_next_async(next_page_link, custom_headers).value! end # @@ -423,12 +394,11 @@ def list_by_products_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_products_next_async(next_page_link, custom_headers:nil) + def list_by_products_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 @@ -500,12 +470,12 @@ def list_by_products_next_async(next_page_link, custom_headers:nil) # # @return [ApiCollection] which provide lazy access to pages of the response. # - def list_by_products_as_lazy(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_products_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_products_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_products_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_products_next_async(next_page_link, custom_headers:custom_headers) + list_by_products_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_groups.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_groups.rb index 1c5068c67e..1c62c336a8 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_groups.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_groups.rb @@ -47,8 +47,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_products(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_products_as_lazy(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_products(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_products_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -78,8 +78,8 @@ def list_by_products(resource_group_name, service_name, product_id, filter:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_products_with_http_info(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_products_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_products_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_products_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! end # @@ -108,24 +108,15 @@ def list_by_products_with_http_info(resource_group_name, service_name, product_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_products_async(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_products_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -184,8 +175,8 @@ def list_by_products_async(resource_group_name, service_name, product_id, filter # will be added to the HTTP request. # # - def create(resource_group_name, service_name, product_id, group_id, custom_headers:nil) - response = create_async(resource_group_name, service_name, product_id, group_id, custom_headers:custom_headers).value! + def create(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + response = create_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! nil end @@ -204,8 +195,8 @@ def create(resource_group_name, service_name, product_id, group_id, custom_heade # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers:nil) - create_async(resource_group_name, service_name, product_id, group_id, custom_headers:custom_headers).value! + def create_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + create_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! end # @@ -223,26 +214,16 @@ def create_with_http_info(resource_group_name, service_name, product_id, group_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_async(resource_group_name, service_name, product_id, group_id, custom_headers:nil) + def create_async(resource_group_name, service_name, product_id, group_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -291,8 +272,8 @@ def create_async(resource_group_name, service_name, product_id, group_id, custom # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, product_id, group_id, custom_headers:nil) - response = delete_async(resource_group_name, service_name, product_id, group_id, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! response.body unless response.nil? end @@ -310,8 +291,8 @@ def delete(resource_group_name, service_name, product_id, group_id, custom_heade # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers:nil) - delete_async(resource_group_name, service_name, product_id, group_id, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! end # @@ -328,26 +309,16 @@ def delete_with_http_info(resource_group_name, service_name, product_id, group_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, product_id, group_id, custom_headers:nil) + def delete_async(resource_group_name, service_name, product_id, group_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'group_id is nil' if group_id.nil? - fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '256'" if !group_id.nil? && group_id.length > 256 - fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1 - fail ArgumentError, "'group_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !group_id.nil? && group_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -403,8 +374,8 @@ def delete_async(resource_group_name, service_name, product_id, group_id, custom # # @return [GroupCollection] operation results. # - def list_by_products_next(next_page_link, custom_headers:nil) - response = list_by_products_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_products_next(next_page_link, custom_headers = nil) + response = list_by_products_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -419,8 +390,8 @@ def list_by_products_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_products_next_with_http_info(next_page_link, custom_headers:nil) - list_by_products_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_products_next_with_http_info(next_page_link, custom_headers = nil) + list_by_products_next_async(next_page_link, custom_headers).value! end # @@ -434,12 +405,11 @@ def list_by_products_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_products_next_async(next_page_link, custom_headers:nil) + def list_by_products_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 @@ -509,12 +479,12 @@ def list_by_products_next_async(next_page_link, custom_headers:nil) # # @return [GroupCollection] which provide lazy access to pages of the response. # - def list_by_products_as_lazy(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_products_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_products_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_products_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_products_next_async(next_page_link, custom_headers:custom_headers) + list_by_products_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_policy.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_policy.rb index 5c01929439..ea4e72b41d 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_policy.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_policy.rb @@ -33,8 +33,8 @@ def initialize(client) # # @return [NOT_IMPLEMENTED] operation results. # - def get(resource_group_name, service_name, product_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, product_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, product_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, product_id, custom_headers).value! response.body unless response.nil? end @@ -50,8 +50,8 @@ def get(resource_group_name, service_name, product_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, product_id, custom_headers:nil) - get_async(resource_group_name, service_name, product_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, product_id, custom_headers = nil) + get_async(resource_group_name, service_name, product_id, custom_headers).value! end # @@ -66,22 +66,15 @@ def get_with_http_info(resource_group_name, service_name, product_id, custom_hea # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, product_id, custom_headers:nil) + def get_async(resource_group_name, service_name, product_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -114,7 +107,6 @@ def get_async(resource_group_name, service_name, product_id, custom_headers:nil) 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: { @@ -148,8 +140,8 @@ def get_async(resource_group_name, service_name, product_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! nil end @@ -169,8 +161,8 @@ def create_or_update(resource_group_name, service_name, product_id, parameters, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! end # @@ -189,16 +181,10 @@ def create_or_update_with_http_info(resource_group_name, service_name, product_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -206,16 +192,16 @@ def create_or_update_async(resource_group_name, service_name, product_id, parame request_headers = {} - request_headers['Content-Type'] = 'application/vnd.ms-azure-apim.policy+xml' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/vnd.ms-azure-apim.policy+xml' + # Serialize Request request_mapper = { - client_side_validation: true, required: true, serialized_name: 'parameters', type: { @@ -223,6 +209,7 @@ def create_or_update_async(resource_group_name, service_name, product_id, parame } } request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policy' @@ -269,8 +256,8 @@ def create_or_update_async(resource_group_name, service_name, product_id, parame # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, product_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, product_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, product_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, if_match, custom_headers).value! nil end @@ -289,8 +276,8 @@ def delete(resource_group_name, service_name, product_id, if_match, custom_heade # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, product_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, product_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, product_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, if_match, custom_headers).value! end # @@ -308,23 +295,16 @@ def delete_with_http_info(resource_group_name, service_name, product_id, if_matc # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, product_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, product_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_subscriptions.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_subscriptions.rb index d405e1276c..ab09e85102 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_subscriptions.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_subscriptions.rb @@ -50,8 +50,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_products(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_products_as_lazy(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_products(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_products_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) first_page.get_all_items end @@ -84,8 +84,8 @@ def list_by_products(resource_group_name, service_name, product_id, filter:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_products_with_http_info(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_products_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_products_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_products_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! end # @@ -117,24 +117,15 @@ def list_by_products_with_http_info(resource_group_name, service_name, product_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_products_async(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_products_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -189,8 +180,8 @@ def list_by_products_async(resource_group_name, service_name, product_id, filter # # @return [SubscriptionCollection] operation results. # - def list_by_products_next(next_page_link, custom_headers:nil) - response = list_by_products_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_products_next(next_page_link, custom_headers = nil) + response = list_by_products_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -204,8 +195,8 @@ def list_by_products_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_products_next_with_http_info(next_page_link, custom_headers:nil) - list_by_products_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_products_next_with_http_info(next_page_link, custom_headers = nil) + list_by_products_next_async(next_page_link, custom_headers).value! end # @@ -218,12 +209,11 @@ def list_by_products_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_products_next_async(next_page_link, custom_headers:nil) + def list_by_products_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 @@ -297,12 +287,12 @@ def list_by_products_next_async(next_page_link, custom_headers:nil) # @return [SubscriptionCollection] which provide lazy access to pages of the # response. # - def list_by_products_as_lazy(resource_group_name, service_name, product_id, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_products_async(resource_group_name, service_name, product_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_products_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_products_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_products_next_async(next_page_link, custom_headers:custom_headers) + list_by_products_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/products.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/products.rb index c47525eb90..3c1fe90deb 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/products.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/products.rb @@ -48,8 +48,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, expand_groups:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, expand_groups:expand_groups, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers) first_page.get_all_items end @@ -80,8 +80,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, expand_groups:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, expand_groups:expand_groups, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers).value! end # @@ -111,20 +111,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, expand_groups:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -181,8 +175,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [ProductContract] operation results. # - def get(resource_group_name, service_name, product_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, product_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, product_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, product_id, custom_headers).value! response.body unless response.nil? end @@ -198,8 +192,8 @@ def get(resource_group_name, service_name, product_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, product_id, custom_headers:nil) - get_async(resource_group_name, service_name, product_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, product_id, custom_headers = nil) + get_async(resource_group_name, service_name, product_id, custom_headers).value! end # @@ -214,22 +208,15 @@ def get_with_http_info(resource_group_name, service_name, product_id, custom_hea # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, product_id, custom_headers:nil) + def get_async(resource_group_name, service_name, product_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -286,8 +273,8 @@ def get_async(resource_group_name, service_name, product_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, product_id, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, product_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers).value! nil end @@ -304,8 +291,8 @@ def create_or_update(resource_group_name, service_name, product_id, parameters, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, product_id, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, product_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers).value! end # @@ -321,28 +308,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, product_i # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, product_id, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ProductContract.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -394,8 +376,8 @@ def create_or_update_async(resource_group_name, service_name, product_id, parame # will be added to the HTTP request. # # - def update(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! nil end @@ -415,8 +397,8 @@ def update(resource_group_name, service_name, product_id, parameters, if_match, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! end # @@ -435,16 +417,10 @@ def update_with_http_info(resource_group_name, service_name, product_id, paramet # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -452,13 +428,14 @@ def update_async(resource_group_name, service_name, product_id, parameters, if_m request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::ProductUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -511,8 +488,8 @@ def update_async(resource_group_name, service_name, product_id, parameters, if_m # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, product_id, if_match, delete_subscriptions:nil, custom_headers:nil) - response = delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions:delete_subscriptions, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions, custom_headers).value! nil end @@ -533,8 +510,8 @@ def delete(resource_group_name, service_name, product_id, if_match, delete_subsc # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, product_id, if_match, delete_subscriptions:nil, custom_headers:nil) - delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions:delete_subscriptions, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions, custom_headers).value! end # @@ -554,23 +531,16 @@ def delete_with_http_info(resource_group_name, service_name, product_id, if_matc # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions:nil, custom_headers:nil) + def delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'product_id is nil' if product_id.nil? - fail ArgumentError, "'product_id' should satisfy the constraint - 'MaxLength': '256'" if !product_id.nil? && product_id.length > 256 - fail ArgumentError, "'product_id' should satisfy the constraint - 'MinLength': '1'" if !product_id.nil? && product_id.length < 1 - fail ArgumentError, "'product_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !product_id.nil? && product_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -616,8 +586,8 @@ def delete_async(resource_group_name, service_name, product_id, if_match, delete # # @return [ProductCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -631,8 +601,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -645,12 +615,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -722,12 +691,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [ProductCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, expand_groups:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, expand_groups:expand_groups, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/properties.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/properties.rb index 70b7622e1a..54a25b09b0 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/properties.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/properties.rb @@ -40,8 +40,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -64,8 +64,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -87,20 +87,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -155,8 +149,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [PropertyCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -170,8 +164,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -184,12 +178,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -253,12 +246,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [PropertyCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/property.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/property.rb index 50948cc660..478e47b4de 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/property.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/property.rb @@ -32,8 +32,8 @@ def initialize(client) # # @return [PropertyContract] operation results. # - def get(resource_group_name, service_name, prop_id, custom_headers:nil) - response = get_async(resource_group_name, service_name, prop_id, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, prop_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, prop_id, custom_headers).value! response.body unless response.nil? end @@ -48,8 +48,8 @@ def get(resource_group_name, service_name, prop_id, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, prop_id, custom_headers:nil) - get_async(resource_group_name, service_name, prop_id, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, prop_id, custom_headers = nil) + get_async(resource_group_name, service_name, prop_id, custom_headers).value! end # @@ -63,21 +63,15 @@ def get_with_http_info(resource_group_name, service_name, prop_id, custom_header # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, prop_id, custom_headers:nil) + def get_async(resource_group_name, service_name, prop_id, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'prop_id is nil' if prop_id.nil? - fail ArgumentError, "'prop_id' should satisfy the constraint - 'MaxLength': '256'" if !prop_id.nil? && prop_id.length > 256 - fail ArgumentError, "'prop_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !prop_id.nil? && prop_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -133,8 +127,8 @@ def get_async(resource_group_name, service_name, prop_id, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, prop_id, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, prop_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers).value! nil end @@ -150,8 +144,8 @@ def create_or_update(resource_group_name, service_name, prop_id, parameters, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, prop_id, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, prop_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers).value! end # @@ -166,27 +160,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, prop_id, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, prop_id, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'prop_id is nil' if prop_id.nil? - fail ArgumentError, "'prop_id' should satisfy the constraint - 'MaxLength': '256'" if !prop_id.nil? && prop_id.length > 256 - fail ArgumentError, "'prop_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !prop_id.nil? && prop_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::PropertyCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -237,8 +227,8 @@ def create_or_update_async(resource_group_name, service_name, prop_id, parameter # will be added to the HTTP request. # # - def update(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers).value! nil end @@ -257,8 +247,8 @@ def update(resource_group_name, service_name, prop_id, parameters, if_match, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers).value! end # @@ -276,15 +266,10 @@ def update_with_http_info(resource_group_name, service_name, prop_id, parameters # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'prop_id is nil' if prop_id.nil? - fail ArgumentError, "'prop_id' should satisfy the constraint - 'MaxLength': '256'" if !prop_id.nil? && prop_id.length > 256 - fail ArgumentError, "'prop_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !prop_id.nil? && prop_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -292,13 +277,14 @@ def update_async(resource_group_name, service_name, prop_id, parameters, if_matc request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::PropertyUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -349,8 +335,8 @@ def update_async(resource_group_name, service_name, prop_id, parameters, if_matc # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, prop_id, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers).value! response.body unless response.nil? end @@ -368,8 +354,8 @@ def delete(resource_group_name, service_name, prop_id, if_match, custom_headers: # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, prop_id, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers).value! end # @@ -386,22 +372,16 @@ def delete_with_http_info(resource_group_name, service_name, prop_id, if_match, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'prop_id is nil' if prop_id.nil? - fail ArgumentError, "'prop_id' should satisfy the constraint - 'MaxLength': '256'" if !prop_id.nil? && prop_id.length > 256 - fail ArgumentError, "'prop_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !prop_id.nil? && prop_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/quota_by_counter_keys.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/quota_by_counter_keys.rb index 3d1ae8343b..236caa4be1 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/quota_by_counter_keys.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/quota_by_counter_keys.rb @@ -34,8 +34,8 @@ def initialize(client) # # @return [QuotaCounterCollection] operation results. # - def list_by_service(resource_group_name, service_name, quota_counter_key, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers:custom_headers).value! + def list_by_service(resource_group_name, service_name, quota_counter_key, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers).value! response.body unless response.nil? end @@ -52,8 +52,8 @@ def list_by_service(resource_group_name, service_name, quota_counter_key, custom # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, quota_counter_key, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, quota_counter_key, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers).value! end # @@ -69,19 +69,15 @@ def list_by_service_with_http_info(resource_group_name, service_name, quota_coun # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, quota_counter_key, 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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.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 @@ -140,8 +136,8 @@ def list_by_service_async(resource_group_name, service_name, quota_counter_key, # will be added to the HTTP request. # # - def update(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:nil) - response = update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers).value! nil end @@ -160,8 +156,8 @@ def update(resource_group_name, service_name, quota_counter_key, parameters, cus # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:nil) - update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) + update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers).value! end # @@ -179,12 +175,9 @@ def update_with_http_info(resource_group_name, service_name, quota_counter_key, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers:nil) + def update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -192,12 +185,13 @@ def update_async(resource_group_name, service_name, quota_counter_key, parameter 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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::QuotaCounterValueContract.mapper() request_content = @client.serialize(request_mapper, parameters) diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/quota_by_period_keys.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/quota_by_period_keys.rb index 2086cb52d4..3ef6886837 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/quota_by_period_keys.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/quota_by_period_keys.rb @@ -34,8 +34,8 @@ def initialize(client) # # @return [QuotaCounterContract] operation results. # - def get(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:nil) - response = get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers = nil) + response = get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers).value! response.body unless response.nil? end @@ -52,8 +52,8 @@ def get(resource_group_name, service_name, quota_counter_key, quota_period_key, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:nil) - get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers = nil) + get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers).value! end # @@ -69,20 +69,16 @@ def get_with_http_info(resource_group_name, service_name, quota_counter_key, quo # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers:nil) + def get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, 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, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? fail ArgumentError, 'quota_period_key is nil' if quota_period_key.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 @@ -140,8 +136,8 @@ def get_async(resource_group_name, service_name, quota_counter_key, quota_period # will be added to the HTTP request. # # - def update(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:nil) - response = update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers).value! nil end @@ -159,8 +155,8 @@ def update(resource_group_name, service_name, quota_counter_key, quota_period_ke # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:nil) - update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) + update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers).value! end # @@ -177,12 +173,9 @@ def update_with_http_info(resource_group_name, service_name, quota_counter_key, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:nil) + def update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? fail ArgumentError, 'quota_period_key is nil' if quota_period_key.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? @@ -191,12 +184,13 @@ def update_async(resource_group_name, service_name, quota_counter_key, quota_per 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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::QuotaCounterValueContract.mapper() request_content = @client.serialize(request_mapper, parameters) diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/regions.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/regions.rb index 57705c1e85..78e70262e2 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/regions.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/regions.rb @@ -31,8 +31,8 @@ def initialize(client) # # @return [RegionListResult] operation results. # - def list_by_service(resource_group_name, service_name, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def list_by_service(resource_group_name, service_name, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -46,8 +46,8 @@ def list_by_service(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, custom_headers).value! end # @@ -60,18 +60,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, custom_hea # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/reports.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/reports.rb index 5119f2dbca..74fe4af141 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/reports.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/reports.rb @@ -43,8 +43,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, aggregation, filter:nil, top:nil, skip:nil, interval:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, aggregation, filter:filter, top:top, skip:skip, interval:interval, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, aggregation, filter = nil, top = nil, skip = nil, interval = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, aggregation, filter, top, skip, interval, custom_headers) first_page.get_all_items end @@ -70,8 +70,8 @@ def list_by_service(resource_group_name, service_name, aggregation, filter:nil, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, aggregation, filter:nil, top:nil, skip:nil, interval:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, aggregation, filter:filter, top:top, skip:skip, interval:interval, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, aggregation, filter = nil, top = nil, skip = nil, interval = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, aggregation, filter, top, skip, interval, custom_headers).value! end # @@ -96,21 +96,15 @@ def list_by_service_with_http_info(resource_group_name, service_name, aggregatio # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, aggregation, filter:nil, top:nil, skip:nil, interval:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, aggregation, filter = nil, top = nil, skip = nil, interval = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'aggregation is nil' if aggregation.nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -165,8 +159,8 @@ def list_by_service_async(resource_group_name, service_name, aggregation, filter # # @return [ReportCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -180,8 +174,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -194,12 +188,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -266,12 +259,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # @return [ReportCollection] which provide lazy access to pages of the # response. # - def list_by_service_as_lazy(resource_group_name, service_name, aggregation, filter:nil, top:nil, skip:nil, interval:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, aggregation, filter:filter, top:top, skip:skip, interval:interval, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, aggregation, filter = nil, top = nil, skip = nil, interval = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, aggregation, filter, top, skip, interval, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/subscriptions.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/subscriptions.rb index bf09fb3b35..d1ad3f9055 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/subscriptions.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/subscriptions.rb @@ -48,8 +48,8 @@ def initialize(client) # # @return [Array] operation results. # - def list(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -80,8 +80,8 @@ def list(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custo # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -111,20 +111,14 @@ def list_with_http_info(resource_group_name, service_name, filter:nil, top:nil, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -181,8 +175,8 @@ def list_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, # # @return [SubscriptionContract] operation results. # - def get(resource_group_name, service_name, sid, custom_headers:nil) - response = get_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, sid, custom_headers = nil) + response = get_async(resource_group_name, service_name, sid, custom_headers).value! response.body unless response.nil? end @@ -198,8 +192,8 @@ def get(resource_group_name, service_name, sid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, sid, custom_headers:nil) - get_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + get_async(resource_group_name, service_name, sid, custom_headers).value! end # @@ -214,21 +208,15 @@ def get_with_http_info(resource_group_name, service_name, sid, custom_headers:ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, sid, custom_headers:nil) + def get_async(resource_group_name, service_name, sid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? - fail ArgumentError, "'sid' should satisfy the constraint - 'MaxLength': '256'" if !sid.nil? && sid.length > 256 - fail ArgumentError, "'sid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !sid.nil? && sid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -286,8 +274,8 @@ def get_async(resource_group_name, service_name, sid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, sid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, sid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers).value! nil end @@ -305,8 +293,8 @@ def create_or_update(resource_group_name, service_name, sid, parameters, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, sid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, sid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers).value! end # @@ -323,27 +311,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, sid, para # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, sid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? - fail ArgumentError, "'sid' should satisfy the constraint - 'MaxLength': '256'" if !sid.nil? && sid.length > 256 - fail ArgumentError, "'sid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !sid.nil? && sid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::SubscriptionCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -395,8 +379,8 @@ def create_or_update_async(resource_group_name, service_name, sid, parameters, c # will be added to the HTTP request. # # - def update(resource_group_name, service_name, sid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, sid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers).value! nil end @@ -416,8 +400,8 @@ def update(resource_group_name, service_name, sid, parameters, if_match, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, sid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, sid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers).value! end # @@ -436,15 +420,10 @@ def update_with_http_info(resource_group_name, service_name, sid, parameters, if # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, sid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? - fail ArgumentError, "'sid' should satisfy the constraint - 'MaxLength': '256'" if !sid.nil? && sid.length > 256 - fail ArgumentError, "'sid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !sid.nil? && sid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -452,13 +431,14 @@ def update_async(resource_group_name, service_name, sid, parameters, if_match, c request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::SubscriptionUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -509,8 +489,8 @@ def update_async(resource_group_name, service_name, sid, parameters, if_match, c # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, sid, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, sid, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, sid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, sid, if_match, custom_headers).value! nil end @@ -529,8 +509,8 @@ def delete(resource_group_name, service_name, sid, if_match, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, sid, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, sid, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, sid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, sid, if_match, custom_headers).value! end # @@ -548,22 +528,16 @@ def delete_with_http_info(resource_group_name, service_name, sid, if_match, cust # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, sid, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, sid, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? - fail ArgumentError, "'sid' should satisfy the constraint - 'MaxLength': '256'" if !sid.nil? && sid.length > 256 - fail ArgumentError, "'sid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !sid.nil? && sid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -611,8 +585,8 @@ def delete_async(resource_group_name, service_name, sid, if_match, custom_header # will be added to the HTTP request. # # - def regenerate_primary_key(resource_group_name, service_name, sid, custom_headers:nil) - response = regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def regenerate_primary_key(resource_group_name, service_name, sid, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers).value! nil end @@ -629,8 +603,8 @@ def regenerate_primary_key(resource_group_name, service_name, sid, custom_header # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid, custom_headers:nil) - regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers).value! end # @@ -646,21 +620,15 @@ def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers:nil) + def regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? - fail ArgumentError, "'sid' should satisfy the constraint - 'MaxLength': '256'" if !sid.nil? && sid.length > 256 - fail ArgumentError, "'sid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !sid.nil? && sid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -707,8 +675,8 @@ def regenerate_primary_key_async(resource_group_name, service_name, sid, custom_ # will be added to the HTTP request. # # - def regenerate_secondary_key(resource_group_name, service_name, sid, custom_headers:nil) - response = regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def regenerate_secondary_key(resource_group_name, service_name, sid, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers).value! nil end @@ -725,8 +693,8 @@ def regenerate_secondary_key(resource_group_name, service_name, sid, custom_head # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_secondary_key_with_http_info(resource_group_name, service_name, sid, custom_headers:nil) - regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value! + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers).value! end # @@ -742,21 +710,15 @@ def regenerate_secondary_key_with_http_info(resource_group_name, service_name, s # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers:nil) + def regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'sid is nil' if sid.nil? - fail ArgumentError, "'sid' should satisfy the constraint - 'MaxLength': '256'" if !sid.nil? && sid.length > 256 - fail ArgumentError, "'sid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !sid.nil? && sid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -801,8 +763,8 @@ def regenerate_secondary_key_async(resource_group_name, service_name, sid, custo # # @return [SubscriptionCollection] operation results. # - def list_next(next_page_link, custom_headers:nil) - response = list_next_async(next_page_link, custom_headers:custom_headers).value! + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -816,8 +778,8 @@ def list_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_next_with_http_info(next_page_link, custom_headers:nil) - list_next_async(next_page_link, custom_headers:custom_headers).value! + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! end # @@ -830,12 +792,11 @@ def list_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_next_async(next_page_link, custom_headers:nil) + 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 @@ -907,12 +868,12 @@ def list_next_async(next_page_link, custom_headers:nil) # @return [SubscriptionCollection] which provide lazy access to pages of the # response. # - def list_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_async(resource_group_name, service_name, filter, top, skip, 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) + list_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_access.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_access.rb index 0c587b6a37..4f3cfd5b61 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_access.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_access.rb @@ -31,8 +31,8 @@ def initialize(client) # # @return [AccessInformationContract] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -46,8 +46,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -60,18 +60,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -129,8 +125,8 @@ def get_async(resource_group_name, service_name, custom_headers:nil) # will be added to the HTTP request. # # - def update(resource_group_name, service_name, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! nil end @@ -148,8 +144,8 @@ def update(resource_group_name, service_name, parameters, if_match, custom_heade # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! end # @@ -166,12 +162,9 @@ def update_with_http_info(resource_group_name, service_name, parameters, if_matc # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -179,13 +172,14 @@ def update_async(resource_group_name, service_name, parameters, if_match, custom request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::AccessInformationUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -231,8 +225,8 @@ def update_async(resource_group_name, service_name, parameters, if_match, custom # will be added to the HTTP request. # # - def regenerate_primary_key(resource_group_name, service_name, custom_headers:nil) - response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_primary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! nil end @@ -246,8 +240,8 @@ def regenerate_primary_key(resource_group_name, service_name, custom_headers:nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers:nil) - regenerate_primary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! end # @@ -260,18 +254,14 @@ def regenerate_primary_key_with_http_info(resource_group_name, service_name, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_primary_key_async(resource_group_name, service_name, custom_headers:nil) + def regenerate_primary_key_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -315,8 +305,8 @@ def regenerate_primary_key_async(resource_group_name, service_name, custom_heade # will be added to the HTTP request. # # - def regenerate_secondary_key(resource_group_name, service_name, custom_headers:nil) - response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_secondary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! nil end @@ -330,8 +320,8 @@ def regenerate_secondary_key(resource_group_name, service_name, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers:nil) - regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! end # @@ -344,18 +334,14 @@ def regenerate_secondary_key_with_http_info(resource_group_name, service_name, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:nil) + def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_access_git.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_access_git.rb index 5e57170d38..124c02d6c5 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_access_git.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_access_git.rb @@ -31,8 +31,8 @@ def initialize(client) # # @return [AccessInformationContract] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -46,8 +46,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -60,18 +60,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -125,8 +121,8 @@ def get_async(resource_group_name, service_name, custom_headers:nil) # will be added to the HTTP request. # # - def regenerate_primary_key(resource_group_name, service_name, custom_headers:nil) - response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_primary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! nil end @@ -140,8 +136,8 @@ def regenerate_primary_key(resource_group_name, service_name, custom_headers:nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers:nil) - regenerate_primary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! end # @@ -154,18 +150,14 @@ def regenerate_primary_key_with_http_info(resource_group_name, service_name, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_primary_key_async(resource_group_name, service_name, custom_headers:nil) + def regenerate_primary_key_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -209,8 +201,8 @@ def regenerate_primary_key_async(resource_group_name, service_name, custom_heade # will be added to the HTTP request. # # - def regenerate_secondary_key(resource_group_name, service_name, custom_headers:nil) - response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_secondary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! nil end @@ -224,8 +216,8 @@ def regenerate_secondary_key(resource_group_name, service_name, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers:nil) - regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! end # @@ -238,18 +230,14 @@ def regenerate_secondary_key_with_http_info(resource_group_name, service_name, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers:nil) + def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_configuration.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_configuration.rb index a449a23a7b..88c33344fb 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_configuration.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_configuration.rb @@ -35,8 +35,8 @@ def initialize(client) # # @return [OperationResultContract] operation results. # - def deploy(resource_group_name, service_name, parameters, custom_headers:nil) - response = deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def deploy(resource_group_name, service_name, parameters, custom_headers = nil) + response = deploy_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -51,9 +51,9 @@ def deploy(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def deploy_async(resource_group_name, service_name, parameters, custom_headers:nil) + def deploy_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -82,8 +82,8 @@ def deploy_async(resource_group_name, service_name, parameters, custom_headers:n # # @return [OperationResultContract] operation results. # - def save(resource_group_name, service_name, parameters, custom_headers:nil) - response = save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def save(resource_group_name, service_name, parameters, custom_headers = nil) + response = save_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -97,9 +97,9 @@ def save(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def save_async(resource_group_name, service_name, parameters, custom_headers:nil) + def save_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_save_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -128,8 +128,8 @@ def save_async(resource_group_name, service_name, parameters, custom_headers:nil # # @return [OperationResultContract] operation results. # - def validate(resource_group_name, service_name, parameters, custom_headers:nil) - response = validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def validate(resource_group_name, service_name, parameters, custom_headers = nil) + response = validate_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -144,9 +144,9 @@ def validate(resource_group_name, service_name, parameters, custom_headers:nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def validate_async(resource_group_name, service_name, parameters, custom_headers:nil) + def validate_async(resource_group_name, service_name, parameters, custom_headers = nil) # Send request - promise = begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers) + promise = begin_validate_async(resource_group_name, service_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -176,8 +176,8 @@ def validate_async(resource_group_name, service_name, parameters, custom_headers # # @return [OperationResultContract] operation results. # - def begin_deploy(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_deploy(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -195,8 +195,8 @@ def begin_deploy(resource_group_name, service_name, parameters, custom_headers:n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_deploy_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_deploy_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_deploy_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -213,24 +213,22 @@ def begin_deploy_with_http_info(resource_group_name, service_name, parameters, c # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_deploy_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::DeployConfigurationParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -290,8 +288,8 @@ def begin_deploy_async(resource_group_name, service_name, parameters, custom_hea # # @return [OperationResultContract] operation results. # - def begin_save(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_save(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_save_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -308,8 +306,8 @@ def begin_save(resource_group_name, service_name, parameters, custom_headers:nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_save_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_save_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_save_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -325,24 +323,22 @@ def begin_save_with_http_info(resource_group_name, service_name, parameters, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_save_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_save_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::SaveConfigurationParameter.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -402,8 +398,8 @@ def begin_save_async(resource_group_name, service_name, parameters, custom_heade # # @return [OperationResultContract] operation results. # - def begin_validate(resource_group_name, service_name, parameters, custom_headers:nil) - response = begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_validate(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_validate_async(resource_group_name, service_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -420,8 +416,8 @@ def begin_validate(resource_group_name, service_name, parameters, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_validate_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil) - begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! + def begin_validate_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_validate_async(resource_group_name, service_name, parameters, custom_headers).value! end # @@ -437,24 +433,22 @@ def begin_validate_with_http_info(resource_group_name, service_name, parameters, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_validate_async(resource_group_name, service_name, parameters, custom_headers:nil) + def begin_validate_async(resource_group_name, service_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::DeployConfigurationParameters.mapper() request_content = @client.serialize(request_mapper, parameters) diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_configuration_sync_state.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_configuration_sync_state.rb index a65c281f5e..a3953d9494 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_configuration_sync_state.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_configuration_sync_state.rb @@ -32,8 +32,8 @@ def initialize(client) # # @return [TenantConfigurationSyncStateContract] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -48,8 +48,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -63,18 +63,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_policy.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_policy.rb index 2371634f04..63604368ff 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_policy.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/tenant_policy.rb @@ -31,8 +31,8 @@ def initialize(client) # # @return [NOT_IMPLEMENTED] operation results. # - def get(resource_group_name, service_name, custom_headers:nil) - response = get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! response.body unless response.nil? end @@ -46,8 +46,8 @@ def get(resource_group_name, service_name, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, custom_headers:nil) - get_async(resource_group_name, service_name, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! end # @@ -60,18 +60,14 @@ def get_with_http_info(resource_group_name, service_name, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, custom_headers:nil) + def get_async(resource_group_name, service_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -104,7 +100,6 @@ def get_async(resource_group_name, service_name, custom_headers:nil) 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: { @@ -136,8 +131,8 @@ def get_async(resource_group_name, service_name, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, parameters, if_match, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, parameters, if_match, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! nil end @@ -155,8 +150,8 @@ def create_or_update(resource_group_name, service_name, parameters, if_match, cu # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, parameters, if_match, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! end # @@ -173,12 +168,9 @@ def create_or_update_with_http_info(resource_group_name, service_name, parameter # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, parameters, if_match, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -186,16 +178,16 @@ def create_or_update_async(resource_group_name, service_name, parameters, if_mat request_headers = {} - request_headers['Content-Type'] = 'application/vnd.ms-azure-apim.policy+xml' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/vnd.ms-azure-apim.policy+xml' + # Serialize Request request_mapper = { - client_side_validation: true, required: true, serialized_name: 'parameters', type: { @@ -203,6 +195,7 @@ def create_or_update_async(resource_group_name, service_name, parameters, if_mat } } request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/policy' @@ -247,8 +240,8 @@ def create_or_update_async(resource_group_name, service_name, parameters, if_mat # will be added to the HTTP request. # # - def delete(resource_group_name, service_name, if_match, custom_headers:nil) - response = delete_async(resource_group_name, service_name, if_match, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, if_match, custom_headers).value! nil end @@ -265,8 +258,8 @@ def delete(resource_group_name, service_name, if_match, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, if_match, custom_headers:nil) - delete_async(resource_group_name, service_name, if_match, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, if_match, custom_headers).value! end # @@ -282,19 +275,15 @@ def delete_with_http_info(resource_group_name, service_name, if_match, custom_he # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, if_match, custom_headers:nil) + def delete_async(resource_group_name, service_name, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_groups.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_groups.rb index 8a1fb5c01c..a03e1f3584 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_groups.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_groups.rb @@ -44,8 +44,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_users(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_users_as_lazy(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_users(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_users_as_lazy(resource_group_name, service_name, uid, filter, top, skip, custom_headers) first_page.get_all_items end @@ -72,8 +72,8 @@ def list_by_users(resource_group_name, service_name, uid, filter:nil, top:nil, s # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_users_with_http_info(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_users_async(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_users_with_http_info(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_users_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! end # @@ -99,24 +99,15 @@ def list_by_users_with_http_info(resource_group_name, service_name, uid, filter: # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_users_async(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_users_async(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -171,8 +162,8 @@ def list_by_users_async(resource_group_name, service_name, uid, filter:nil, top: # # @return [GroupCollection] operation results. # - def list_by_users_next(next_page_link, custom_headers:nil) - response = list_by_users_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_users_next(next_page_link, custom_headers = nil) + response = list_by_users_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -186,8 +177,8 @@ def list_by_users_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_users_next_with_http_info(next_page_link, custom_headers:nil) - list_by_users_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_users_next_with_http_info(next_page_link, custom_headers = nil) + list_by_users_next_async(next_page_link, custom_headers).value! end # @@ -200,12 +191,11 @@ def list_by_users_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_users_next_async(next_page_link, custom_headers:nil) + def list_by_users_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 @@ -272,12 +262,12 @@ def list_by_users_next_async(next_page_link, custom_headers:nil) # # @return [GroupCollection] which provide lazy access to pages of the response. # - def list_by_users_as_lazy(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_users_async(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_users_as_lazy(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_users_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_users_next_async(next_page_link, custom_headers:custom_headers) + list_by_users_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_identities.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_identities.rb index 65e044c836..1ad8839657 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_identities.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_identities.rb @@ -33,8 +33,8 @@ def initialize(client) # # @return [UserIdentityCollection] operation results. # - def list_by_users(resource_group_name, service_name, uid, custom_headers:nil) - response = list_by_users_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def list_by_users(resource_group_name, service_name, uid, custom_headers = nil) + response = list_by_users_async(resource_group_name, service_name, uid, custom_headers).value! response.body unless response.nil? end @@ -50,8 +50,8 @@ def list_by_users(resource_group_name, service_name, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_users_with_http_info(resource_group_name, service_name, uid, custom_headers:nil) - list_by_users_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def list_by_users_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + list_by_users_async(resource_group_name, service_name, uid, custom_headers).value! end # @@ -66,22 +66,15 @@ def list_by_users_with_http_info(resource_group_name, service_name, uid, custom_ # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_users_async(resource_group_name, service_name, uid, custom_headers:nil) + def list_by_users_async(resource_group_name, service_name, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_subscriptions.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_subscriptions.rb index 7b880d377f..31f4f05812 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_subscriptions.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/user_subscriptions.rb @@ -50,8 +50,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_users(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_users_as_lazy(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_users(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_users_as_lazy(resource_group_name, service_name, uid, filter, top, skip, custom_headers) first_page.get_all_items end @@ -84,8 +84,8 @@ def list_by_users(resource_group_name, service_name, uid, filter:nil, top:nil, s # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_users_with_http_info(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_users_async(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_users_with_http_info(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_users_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! end # @@ -117,24 +117,15 @@ def list_by_users_with_http_info(resource_group_name, service_name, uid, filter: # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_users_async(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_users_async(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -189,8 +180,8 @@ def list_by_users_async(resource_group_name, service_name, uid, filter:nil, top: # # @return [SubscriptionCollection] operation results. # - def list_by_users_next(next_page_link, custom_headers:nil) - response = list_by_users_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_users_next(next_page_link, custom_headers = nil) + response = list_by_users_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -204,8 +195,8 @@ def list_by_users_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_users_next_with_http_info(next_page_link, custom_headers:nil) - list_by_users_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_users_next_with_http_info(next_page_link, custom_headers = nil) + list_by_users_next_async(next_page_link, custom_headers).value! end # @@ -218,12 +209,11 @@ def list_by_users_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_users_next_async(next_page_link, custom_headers:nil) + def list_by_users_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 @@ -297,12 +287,12 @@ def list_by_users_next_async(next_page_link, custom_headers:nil) # @return [SubscriptionCollection] which provide lazy access to pages of the # response. # - def list_by_users_as_lazy(resource_group_name, service_name, uid, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_users_async(resource_group_name, service_name, uid, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_users_as_lazy(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_users_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_users_next_async(next_page_link, custom_headers:custom_headers) + list_by_users_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/users.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/users.rb index 8fa737b0d7..85cd961fed 100644 --- a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/users.rb +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/users.rb @@ -50,8 +50,8 @@ def initialize(client) # # @return [Array] operation results. # - def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - first_page = list_by_service_as_lazy(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers) + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) first_page.get_all_items end @@ -84,8 +84,8 @@ def list_by_service(resource_group_name, service_name, filter:nil, top:nil, skip # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_with_http_info(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! end # @@ -117,20 +117,14 @@ def list_by_service_with_http_info(resource_group_name, service_name, filter:nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? - fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 - fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -187,8 +181,8 @@ def list_by_service_async(resource_group_name, service_name, filter:nil, top:nil # # @return [UserContract] operation results. # - def get(resource_group_name, service_name, uid, custom_headers:nil) - response = get_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def get(resource_group_name, service_name, uid, custom_headers = nil) + response = get_async(resource_group_name, service_name, uid, custom_headers).value! response.body unless response.nil? end @@ -204,8 +198,8 @@ def get(resource_group_name, service_name, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_with_http_info(resource_group_name, service_name, uid, custom_headers:nil) - get_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def get_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + get_async(resource_group_name, service_name, uid, custom_headers).value! end # @@ -220,22 +214,15 @@ def get_with_http_info(resource_group_name, service_name, uid, custom_headers:ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_async(resource_group_name, service_name, uid, custom_headers:nil) + def get_async(resource_group_name, service_name, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -292,8 +279,8 @@ def get_async(resource_group_name, service_name, uid, custom_headers:nil) # will be added to the HTTP request. # # - def create_or_update(resource_group_name, service_name, uid, parameters, custom_headers:nil) - response = create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers:custom_headers).value! + def create_or_update(resource_group_name, service_name, uid, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers).value! nil end @@ -310,8 +297,8 @@ def create_or_update(resource_group_name, service_name, uid, parameters, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def create_or_update_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers:nil) - create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers:custom_headers).value! + def create_or_update_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers).value! end # @@ -327,28 +314,23 @@ def create_or_update_with_http_info(resource_group_name, service_name, uid, para # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers:nil) + def create_or_update_async(resource_group_name, service_name, uid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::UserCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -401,8 +383,8 @@ def create_or_update_async(resource_group_name, service_name, uid, parameters, c # # @return [ErrorBodyContract] operation results. # - def update(resource_group_name, service_name, uid, parameters, if_match, custom_headers:nil) - response = update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers:custom_headers).value! + def update(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers).value! response.body unless response.nil? end @@ -422,8 +404,8 @@ def update(resource_group_name, service_name, uid, parameters, if_match, custom_ # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def update_with_http_info(resource_group_name, service_name, uid, parameters, if_match, custom_headers:nil) - update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers:custom_headers).value! + def update_with_http_info(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers).value! end # @@ -442,16 +424,10 @@ def update_with_http_info(resource_group_name, service_name, uid, parameters, if # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers:nil) + def update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -459,13 +435,14 @@ def update_async(resource_group_name, service_name, uid, parameters, if_match, c request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::UserUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -529,8 +506,8 @@ def update_async(resource_group_name, service_name, uid, parameters, if_match, c # # @return [ErrorBodyContract] operation results. # - def delete(resource_group_name, service_name, uid, if_match, delete_subscriptions:nil, custom_headers:nil) - response = delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions:delete_subscriptions, custom_headers:custom_headers).value! + def delete(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, custom_headers = nil) + response = delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions, custom_headers).value! response.body unless response.nil? end @@ -551,8 +528,8 @@ def delete(resource_group_name, service_name, uid, if_match, delete_subscription # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def delete_with_http_info(resource_group_name, service_name, uid, if_match, delete_subscriptions:nil, custom_headers:nil) - delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions:delete_subscriptions, custom_headers:custom_headers).value! + def delete_with_http_info(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, custom_headers = nil) + delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions, custom_headers).value! end # @@ -572,23 +549,16 @@ def delete_with_http_info(resource_group_name, service_name, uid, if_match, dele # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions:nil, custom_headers:nil) + def delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'if_match is nil' if if_match.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -647,8 +617,8 @@ def delete_async(resource_group_name, service_name, uid, if_match, delete_subscr # # @return [GenerateSsoUrlResult] operation results. # - def generate_sso_url(resource_group_name, service_name, uid, custom_headers:nil) - response = generate_sso_url_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def generate_sso_url(resource_group_name, service_name, uid, custom_headers = nil) + response = generate_sso_url_async(resource_group_name, service_name, uid, custom_headers).value! response.body unless response.nil? end @@ -665,8 +635,8 @@ def generate_sso_url(resource_group_name, service_name, uid, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def generate_sso_url_with_http_info(resource_group_name, service_name, uid, custom_headers:nil) - generate_sso_url_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value! + def generate_sso_url_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + generate_sso_url_async(resource_group_name, service_name, uid, custom_headers).value! end # @@ -682,22 +652,15 @@ def generate_sso_url_with_http_info(resource_group_name, service_name, uid, cust # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def generate_sso_url_async(resource_group_name, service_name, uid, custom_headers:nil) + def generate_sso_url_async(resource_group_name, service_name, uid, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} - request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid @@ -756,8 +719,8 @@ def generate_sso_url_async(resource_group_name, service_name, uid, custom_header # # @return [UserTokenResult] operation results. # - def get_shared_access_token(resource_group_name, service_name, uid, parameters, custom_headers:nil) - response = get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers:custom_headers).value! + def get_shared_access_token(resource_group_name, service_name, uid, parameters, custom_headers = nil) + response = get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers).value! response.body unless response.nil? end @@ -775,8 +738,8 @@ def get_shared_access_token(resource_group_name, service_name, uid, parameters, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_shared_access_token_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers:nil) - get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers:custom_headers).value! + def get_shared_access_token_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers = nil) + get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers).value! end # @@ -793,28 +756,23 @@ def get_shared_access_token_with_http_info(resource_group_name, service_name, ui # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers:nil) + def get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'service_name is nil' if service_name.nil? - fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50 - fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1 - fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil? fail ArgumentError, 'uid is nil' if uid.nil? - fail ArgumentError, "'uid' should satisfy the constraint - 'MaxLength': '256'" if !uid.nil? && uid.length > 256 - fail ArgumentError, "'uid' should satisfy the constraint - 'MinLength': '1'" if !uid.nil? && uid.length < 1 - fail ArgumentError, "'uid' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !uid.nil? && uid.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + request_headers['Content-Type'] = 'application/json; charset=utf-8' + # Serialize Request request_mapper = Azure::ApiManagement::Mgmt::V2016_10_10::Models::UserTokenParameters.mapper() request_content = @client.serialize(request_mapper, parameters) @@ -871,8 +829,8 @@ def get_shared_access_token_async(resource_group_name, service_name, uid, parame # # @return [UserCollection] operation results. # - def list_by_service_next(next_page_link, custom_headers:nil) - response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -886,8 +844,8 @@ def list_by_service_next(next_page_link, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) - list_by_service_next_async(next_page_link, custom_headers:custom_headers).value! + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! end # @@ -900,12 +858,11 @@ def list_by_service_next_with_http_info(next_page_link, custom_headers:nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_service_next_async(next_page_link, custom_headers:nil) + def list_by_service_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 @@ -978,12 +935,12 @@ def list_by_service_next_async(next_page_link, custom_headers:nil) # # @return [UserCollection] which provide lazy access to pages of the response. # - def list_by_service_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil) - response = list_by_service_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value! + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| - list_by_service_next_async(next_page_link, custom_headers:custom_headers) + list_by_service_next_async(next_page_link, custom_headers) end page end diff --git a/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/version.rb b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/version.rb new file mode 100644 index 0000000000..30548f0dda --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/version.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2016_10_10 + VERSION = '0.17.0' +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management.rb new file mode 100644 index 0000000000..4fd6c21d9b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management.rb @@ -0,0 +1,291 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2018-01-01/generated/azure_mgmt_api_management/module_definition' +require 'ms_rest_azure' + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + autoload :Policy, '2018-01-01/generated/azure_mgmt_api_management/policy.rb' + autoload :PolicySnippets, '2018-01-01/generated/azure_mgmt_api_management/policy_snippets.rb' + autoload :Regions, '2018-01-01/generated/azure_mgmt_api_management/regions.rb' + autoload :Api, '2018-01-01/generated/azure_mgmt_api_management/api.rb' + autoload :ApiRevisions, '2018-01-01/generated/azure_mgmt_api_management/api_revisions.rb' + autoload :ApiRelease, '2018-01-01/generated/azure_mgmt_api_management/api_release.rb' + autoload :ApiOperation, '2018-01-01/generated/azure_mgmt_api_management/api_operation.rb' + autoload :ApiOperationPolicy, '2018-01-01/generated/azure_mgmt_api_management/api_operation_policy.rb' + autoload :ApiProduct, '2018-01-01/generated/azure_mgmt_api_management/api_product.rb' + autoload :ApiPolicy, '2018-01-01/generated/azure_mgmt_api_management/api_policy.rb' + autoload :ApiSchema, '2018-01-01/generated/azure_mgmt_api_management/api_schema.rb' + autoload :ApiDiagnostic, '2018-01-01/generated/azure_mgmt_api_management/api_diagnostic.rb' + autoload :ApiDiagnosticLogger, '2018-01-01/generated/azure_mgmt_api_management/api_diagnostic_logger.rb' + autoload :ApiIssue, '2018-01-01/generated/azure_mgmt_api_management/api_issue.rb' + autoload :ApiIssueComment, '2018-01-01/generated/azure_mgmt_api_management/api_issue_comment.rb' + autoload :ApiIssueAttachment, '2018-01-01/generated/azure_mgmt_api_management/api_issue_attachment.rb' + autoload :AuthorizationServer, '2018-01-01/generated/azure_mgmt_api_management/authorization_server.rb' + autoload :Backend, '2018-01-01/generated/azure_mgmt_api_management/backend.rb' + autoload :Certificate, '2018-01-01/generated/azure_mgmt_api_management/certificate.rb' + autoload :ApiManagementOperations, '2018-01-01/generated/azure_mgmt_api_management/api_management_operations.rb' + autoload :ApiManagementService, '2018-01-01/generated/azure_mgmt_api_management/api_management_service.rb' + autoload :Diagnostic, '2018-01-01/generated/azure_mgmt_api_management/diagnostic.rb' + autoload :DiagnosticLogger, '2018-01-01/generated/azure_mgmt_api_management/diagnostic_logger.rb' + autoload :EmailTemplate, '2018-01-01/generated/azure_mgmt_api_management/email_template.rb' + autoload :Group, '2018-01-01/generated/azure_mgmt_api_management/group.rb' + autoload :GroupUser, '2018-01-01/generated/azure_mgmt_api_management/group_user.rb' + autoload :IdentityProvider, '2018-01-01/generated/azure_mgmt_api_management/identity_provider.rb' + autoload :Logger, '2018-01-01/generated/azure_mgmt_api_management/logger.rb' + autoload :Notification, '2018-01-01/generated/azure_mgmt_api_management/notification.rb' + autoload :NotificationRecipientUser, '2018-01-01/generated/azure_mgmt_api_management/notification_recipient_user.rb' + autoload :NotificationRecipientEmail, '2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb' + autoload :NetworkStatus, '2018-01-01/generated/azure_mgmt_api_management/network_status.rb' + autoload :OpenIdConnectProvider, '2018-01-01/generated/azure_mgmt_api_management/open_id_connect_provider.rb' + autoload :SignInSettings, '2018-01-01/generated/azure_mgmt_api_management/sign_in_settings.rb' + autoload :SignUpSettings, '2018-01-01/generated/azure_mgmt_api_management/sign_up_settings.rb' + autoload :DelegationSettings, '2018-01-01/generated/azure_mgmt_api_management/delegation_settings.rb' + autoload :Product, '2018-01-01/generated/azure_mgmt_api_management/product.rb' + autoload :ProductApi, '2018-01-01/generated/azure_mgmt_api_management/product_api.rb' + autoload :ProductGroup, '2018-01-01/generated/azure_mgmt_api_management/product_group.rb' + autoload :ProductSubscriptions, '2018-01-01/generated/azure_mgmt_api_management/product_subscriptions.rb' + autoload :ProductPolicy, '2018-01-01/generated/azure_mgmt_api_management/product_policy.rb' + autoload :Property, '2018-01-01/generated/azure_mgmt_api_management/property.rb' + autoload :QuotaByCounterKeys, '2018-01-01/generated/azure_mgmt_api_management/quota_by_counter_keys.rb' + autoload :QuotaByPeriodKeys, '2018-01-01/generated/azure_mgmt_api_management/quota_by_period_keys.rb' + autoload :Reports, '2018-01-01/generated/azure_mgmt_api_management/reports.rb' + autoload :Subscription, '2018-01-01/generated/azure_mgmt_api_management/subscription.rb' + autoload :TagResource, '2018-01-01/generated/azure_mgmt_api_management/tag_resource.rb' + autoload :Tag, '2018-01-01/generated/azure_mgmt_api_management/tag.rb' + autoload :TagDescription, '2018-01-01/generated/azure_mgmt_api_management/tag_description.rb' + autoload :OperationOperations, '2018-01-01/generated/azure_mgmt_api_management/operation_operations.rb' + autoload :TenantAccess, '2018-01-01/generated/azure_mgmt_api_management/tenant_access.rb' + autoload :TenantAccessGit, '2018-01-01/generated/azure_mgmt_api_management/tenant_access_git.rb' + autoload :TenantConfiguration, '2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb' + autoload :User, '2018-01-01/generated/azure_mgmt_api_management/user.rb' + autoload :UserGroup, '2018-01-01/generated/azure_mgmt_api_management/user_group.rb' + autoload :UserSubscription, '2018-01-01/generated/azure_mgmt_api_management/user_subscription.rb' + autoload :UserIdentities, '2018-01-01/generated/azure_mgmt_api_management/user_identities.rb' + autoload :ApiVersionSet, '2018-01-01/generated/azure_mgmt_api_management/api_version_set.rb' + autoload :ApiExport, '2018-01-01/generated/azure_mgmt_api_management/api_export.rb' + autoload :ApiManagementClient, '2018-01-01/generated/azure_mgmt_api_management/api_management_client.rb' + + module Models + autoload :ApiManagementServiceListResult, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb' + autoload :ApiManagementServiceGetSsoTokenResult, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb' + autoload :ErrorResponse, '2018-01-01/generated/azure_mgmt_api_management/models/error_response.rb' + autoload :ApiManagementServiceCheckNameAvailabilityParameters, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb' + autoload :PolicyCollection, '2018-01-01/generated/azure_mgmt_api_management/models/policy_collection.rb' + autoload :ApiManagementServiceNameAvailabilityResult, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb' + autoload :PolicySnippetsCollection, '2018-01-01/generated/azure_mgmt_api_management/models/policy_snippets_collection.rb' + autoload :ApiManagementServiceApplyNetworkConfigurationParameters, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_apply_network_configuration_parameters.rb' + autoload :RegionListResult, '2018-01-01/generated/azure_mgmt_api_management/models/region_list_result.rb' + autoload :ApiManagementServiceUploadCertificateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb' + autoload :ApiExportResult, '2018-01-01/generated/azure_mgmt_api_management/models/api_export_result.rb' + autoload :HostnameConfigurationOld, '2018-01-01/generated/azure_mgmt_api_management/models/hostname_configuration_old.rb' + autoload :CertificateInformation, '2018-01-01/generated/azure_mgmt_api_management/models/certificate_information.rb' + autoload :CertificateConfiguration, '2018-01-01/generated/azure_mgmt_api_management/models/certificate_configuration.rb' + autoload :ApiCollection, '2018-01-01/generated/azure_mgmt_api_management/models/api_collection.rb' + autoload :HostnameConfiguration, '2018-01-01/generated/azure_mgmt_api_management/models/hostname_configuration.rb' + autoload :ApiCreateOrUpdateParameter, '2018-01-01/generated/azure_mgmt_api_management/models/api_create_or_update_parameter.rb' + autoload :VirtualNetworkConfiguration, '2018-01-01/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb' + autoload :OAuth2AuthenticationSettingsContract, '2018-01-01/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb' + autoload :ApiManagementServiceSkuProperties, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb' + autoload :SubscriptionKeyParameterNamesContract, '2018-01-01/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb' + autoload :AdditionalLocation, '2018-01-01/generated/azure_mgmt_api_management/models/additional_location.rb' + autoload :ApiRevisionContract, '2018-01-01/generated/azure_mgmt_api_management/models/api_revision_contract.rb' + autoload :ApiManagementServiceBackupRestoreParameters, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb' + autoload :ApiRevisionInfoContract, '2018-01-01/generated/azure_mgmt_api_management/models/api_revision_info_contract.rb' + autoload :ApiManagementServiceBaseProperties, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_base_properties.rb' + autoload :ApiReleaseCollection, '2018-01-01/generated/azure_mgmt_api_management/models/api_release_collection.rb' + autoload :ApiManagementServiceIdentity, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_identity.rb' + autoload :OperationCollection, '2018-01-01/generated/azure_mgmt_api_management/models/operation_collection.rb' + autoload :TagDescriptionCreateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/tag_description_create_parameters.rb' + autoload :RepresentationContract, '2018-01-01/generated/azure_mgmt_api_management/models/representation_contract.rb' + autoload :ApimResource, '2018-01-01/generated/azure_mgmt_api_management/models/apim_resource.rb' + autoload :ResponseContract, '2018-01-01/generated/azure_mgmt_api_management/models/response_contract.rb' + autoload :TagDescriptionCollection, '2018-01-01/generated/azure_mgmt_api_management/models/tag_description_collection.rb' + autoload :OperationUpdateContract, '2018-01-01/generated/azure_mgmt_api_management/models/operation_update_contract.rb' + autoload :ErrorFieldContract, '2018-01-01/generated/azure_mgmt_api_management/models/error_field_contract.rb' + autoload :SchemaCollection, '2018-01-01/generated/azure_mgmt_api_management/models/schema_collection.rb' + autoload :UserUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/user_update_parameters.rb' + autoload :PropertyCollection, '2018-01-01/generated/azure_mgmt_api_management/models/property_collection.rb' + autoload :UserTokenResult, '2018-01-01/generated/azure_mgmt_api_management/models/user_token_result.rb' + autoload :PolicySnippetContract, '2018-01-01/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb' + autoload :UserTokenParameters, '2018-01-01/generated/azure_mgmt_api_management/models/user_token_parameters.rb' + autoload :RegionContract, '2018-01-01/generated/azure_mgmt_api_management/models/region_contract.rb' + autoload :UserIdentityCollection, '2018-01-01/generated/azure_mgmt_api_management/models/user_identity_collection.rb' + autoload :Resource, '2018-01-01/generated/azure_mgmt_api_management/models/resource.rb' + autoload :UserCreateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/user_create_parameters.rb' + autoload :ApiVersionSetContractDetails, '2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_contract_details.rb' + autoload :ProductEntityBaseParameters, '2018-01-01/generated/azure_mgmt_api_management/models/product_entity_base_parameters.rb' + autoload :TagCreateUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/tag_create_update_parameters.rb' + autoload :OperationTagResourceContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/operation_tag_resource_contract_properties.rb' + autoload :ApiManagementServiceUpdateHostnameParameters, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb' + autoload :TagTagResourceContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/tag_tag_resource_contract_properties.rb' + autoload :OperationDisplay, '2018-01-01/generated/azure_mgmt_api_management/models/operation_display.rb' + autoload :TagResourceCollection, '2018-01-01/generated/azure_mgmt_api_management/models/tag_resource_collection.rb' + autoload :Operation, '2018-01-01/generated/azure_mgmt_api_management/models/operation.rb' + autoload :ProductCollection, '2018-01-01/generated/azure_mgmt_api_management/models/product_collection.rb' + autoload :OperationListResult, '2018-01-01/generated/azure_mgmt_api_management/models/operation_list_result.rb' + autoload :AuthorizationServerCollection, '2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_collection.rb' + autoload :EmailTemplateParametersContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/email_template_parameters_contract_properties.rb' + autoload :TokenBodyParameterContract, '2018-01-01/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb' + autoload :TagCollection, '2018-01-01/generated/azure_mgmt_api_management/models/tag_collection.rb' + autoload :BackendAuthorizationHeaderCredentials, '2018-01-01/generated/azure_mgmt_api_management/models/backend_authorization_header_credentials.rb' + autoload :EmailTemplateCollection, '2018-01-01/generated/azure_mgmt_api_management/models/email_template_collection.rb' + autoload :BackendServiceFabricClusterProperties, '2018-01-01/generated/azure_mgmt_api_management/models/backend_service_fabric_cluster_properties.rb' + autoload :EmailTemplateUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/email_template_update_parameters.rb' + autoload :BackendCredentialsContract, '2018-01-01/generated/azure_mgmt_api_management/models/backend_credentials_contract.rb' + autoload :GroupContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/group_contract_properties.rb' + autoload :BackendTlsProperties, '2018-01-01/generated/azure_mgmt_api_management/models/backend_tls_properties.rb' + autoload :SubscriptionUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb' + autoload :DeployConfigurationParameters, '2018-01-01/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb' + autoload :GroupCollection, '2018-01-01/generated/azure_mgmt_api_management/models/group_collection.rb' + autoload :BackendUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/backend_update_parameters.rb' + autoload :GroupCreateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/group_create_parameters.rb' + autoload :AccessInformationContract, '2018-01-01/generated/azure_mgmt_api_management/models/access_information_contract.rb' + autoload :GroupUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/group_update_parameters.rb' + autoload :CertificateCreateOrUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb' + autoload :UserIdentityContract, '2018-01-01/generated/azure_mgmt_api_management/models/user_identity_contract.rb' + autoload :ApiCreateOrUpdatePropertiesWsdlSelector, '2018-01-01/generated/azure_mgmt_api_management/models/api_create_or_update_properties_wsdl_selector.rb' + autoload :UserEntityBaseParameters, '2018-01-01/generated/azure_mgmt_api_management/models/user_entity_base_parameters.rb' + autoload :AuthenticationSettingsContract, '2018-01-01/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb' + autoload :SubscriptionCreateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb' + autoload :ApiRevisionCollection, '2018-01-01/generated/azure_mgmt_api_management/models/api_revision_collection.rb' + autoload :UserCollection, '2018-01-01/generated/azure_mgmt_api_management/models/user_collection.rb' + autoload :ApiVersionSetEntityBase, '2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_entity_base.rb' + autoload :RequestReportCollection, '2018-01-01/generated/azure_mgmt_api_management/models/request_report_collection.rb' + autoload :RequestContract, '2018-01-01/generated/azure_mgmt_api_management/models/request_contract.rb' + autoload :IdentityProviderList, '2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_list.rb' + autoload :ApiVersionSetCollection, '2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_collection.rb' + autoload :IdentityProviderUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb' + autoload :IssueCommentCollection, '2018-01-01/generated/azure_mgmt_api_management/models/issue_comment_collection.rb' + autoload :IdentityProviderBaseParameters, '2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_base_parameters.rb' + autoload :LoggerCollection, '2018-01-01/generated/azure_mgmt_api_management/models/logger_collection.rb' + autoload :LoggerUpdateContract, '2018-01-01/generated/azure_mgmt_api_management/models/logger_update_contract.rb' + autoload :GenerateSsoUrlResult, '2018-01-01/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb' + autoload :RecipientsContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/recipients_contract_properties.rb' + autoload :TagResourceContract, '2018-01-01/generated/azure_mgmt_api_management/models/tag_resource_contract.rb' + autoload :RequestReportRecordContract, '2018-01-01/generated/azure_mgmt_api_management/models/request_report_record_contract.rb' + autoload :OperationResultContract, '2018-01-01/generated/azure_mgmt_api_management/models/operation_result_contract.rb' + autoload :NotificationCollection, '2018-01-01/generated/azure_mgmt_api_management/models/notification_collection.rb' + autoload :AuthorizationServerContractBaseProperties, '2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_contract_base_properties.rb' + autoload :ReportCollection, '2018-01-01/generated/azure_mgmt_api_management/models/report_collection.rb' + autoload :BackendProperties, '2018-01-01/generated/azure_mgmt_api_management/models/backend_properties.rb' + autoload :RecipientUserCollection, '2018-01-01/generated/azure_mgmt_api_management/models/recipient_user_collection.rb' + autoload :BackendBaseParameters, '2018-01-01/generated/azure_mgmt_api_management/models/backend_base_parameters.rb' + autoload :ReportRecordContract, '2018-01-01/generated/azure_mgmt_api_management/models/report_record_contract.rb' + autoload :AccessInformationUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb' + autoload :RecipientEmailCollection, '2018-01-01/generated/azure_mgmt_api_management/models/recipient_email_collection.rb' + autoload :ConnectivityStatusContract, '2018-01-01/generated/azure_mgmt_api_management/models/connectivity_status_contract.rb' + autoload :ApiEntityBaseContract, '2018-01-01/generated/azure_mgmt_api_management/models/api_entity_base_contract.rb' + autoload :NetworkStatusContract, '2018-01-01/generated/azure_mgmt_api_management/models/network_status_contract.rb' + autoload :ParameterContract, '2018-01-01/generated/azure_mgmt_api_management/models/parameter_contract.rb' + autoload :NetworkStatusContractByLocation, '2018-01-01/generated/azure_mgmt_api_management/models/network_status_contract_by_location.rb' + autoload :IssueCollection, '2018-01-01/generated/azure_mgmt_api_management/models/issue_collection.rb' + autoload :QuotaCounterValueContract, '2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb' + autoload :DiagnosticCollection, '2018-01-01/generated/azure_mgmt_api_management/models/diagnostic_collection.rb' + autoload :OpenIdConnectProviderCollection, '2018-01-01/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb' + autoload :SaveConfigurationParameter, '2018-01-01/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb' + autoload :OpenidConnectProviderUpdateContract, '2018-01-01/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb' + autoload :X509CertificateName, '2018-01-01/generated/azure_mgmt_api_management/models/x509certificate_name.rb' + autoload :QuotaCounterCollection, '2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_collection.rb' + autoload :BackendCollection, '2018-01-01/generated/azure_mgmt_api_management/models/backend_collection.rb' + autoload :TermsOfServiceProperties, '2018-01-01/generated/azure_mgmt_api_management/models/terms_of_service_properties.rb' + autoload :ApiUpdateContract, '2018-01-01/generated/azure_mgmt_api_management/models/api_update_contract.rb' + autoload :QuotaCounterContract, '2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_contract.rb' + autoload :OperationEntityBaseContract, '2018-01-01/generated/azure_mgmt_api_management/models/operation_entity_base_contract.rb' + autoload :SubscriptionsDelegationSettingsProperties, '2018-01-01/generated/azure_mgmt_api_management/models/subscriptions_delegation_settings_properties.rb' + autoload :TenantConfigurationSyncStateContract, '2018-01-01/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb' + autoload :RegistrationDelegationSettingsProperties, '2018-01-01/generated/azure_mgmt_api_management/models/registration_delegation_settings_properties.rb' + autoload :BackendProxyContract, '2018-01-01/generated/azure_mgmt_api_management/models/backend_proxy_contract.rb' + autoload :QuotaCounterValueContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_value_contract_properties.rb' + autoload :ApiVersionSetUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_update_parameters.rb' + autoload :ProductUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/product_update_parameters.rb' + autoload :OperationResultLogItemContract, '2018-01-01/generated/azure_mgmt_api_management/models/operation_result_log_item_contract.rb' + autoload :PropertyEntityBaseParameters, '2018-01-01/generated/azure_mgmt_api_management/models/property_entity_base_parameters.rb' + autoload :IssueAttachmentCollection, '2018-01-01/generated/azure_mgmt_api_management/models/issue_attachment_collection.rb' + autoload :SubscriptionCollection, '2018-01-01/generated/azure_mgmt_api_management/models/subscription_collection.rb' + autoload :CertificateCollection, '2018-01-01/generated/azure_mgmt_api_management/models/certificate_collection.rb' + autoload :PropertyUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/property_update_parameters.rb' + autoload :PolicyContract, '2018-01-01/generated/azure_mgmt_api_management/models/policy_contract.rb' + autoload :ApiContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/api_contract_properties.rb' + autoload :ApiContract, '2018-01-01/generated/azure_mgmt_api_management/models/api_contract.rb' + autoload :ApiReleaseContract, '2018-01-01/generated/azure_mgmt_api_management/models/api_release_contract.rb' + autoload :OperationContract, '2018-01-01/generated/azure_mgmt_api_management/models/operation_contract.rb' + autoload :SchemaContract, '2018-01-01/generated/azure_mgmt_api_management/models/schema_contract.rb' + autoload :IssueContract, '2018-01-01/generated/azure_mgmt_api_management/models/issue_contract.rb' + autoload :IssueCommentContract, '2018-01-01/generated/azure_mgmt_api_management/models/issue_comment_contract.rb' + autoload :IssueAttachmentContract, '2018-01-01/generated/azure_mgmt_api_management/models/issue_attachment_contract.rb' + autoload :LoggerContract, '2018-01-01/generated/azure_mgmt_api_management/models/logger_contract.rb' + autoload :DiagnosticContract, '2018-01-01/generated/azure_mgmt_api_management/models/diagnostic_contract.rb' + autoload :ProductTagResourceContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/product_tag_resource_contract_properties.rb' + autoload :ApiTagResourceContractProperties, '2018-01-01/generated/azure_mgmt_api_management/models/api_tag_resource_contract_properties.rb' + autoload :ProductContract, '2018-01-01/generated/azure_mgmt_api_management/models/product_contract.rb' + autoload :AuthorizationServerContract, '2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_contract.rb' + autoload :AuthorizationServerUpdateContract, '2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_update_contract.rb' + autoload :BackendContract, '2018-01-01/generated/azure_mgmt_api_management/models/backend_contract.rb' + autoload :BackendReconnectContract, '2018-01-01/generated/azure_mgmt_api_management/models/backend_reconnect_contract.rb' + autoload :CertificateContract, '2018-01-01/generated/azure_mgmt_api_management/models/certificate_contract.rb' + autoload :ApiManagementServiceResource, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_resource.rb' + autoload :ApiManagementServiceUpdateParameters, '2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_update_parameters.rb' + autoload :EmailTemplateContract, '2018-01-01/generated/azure_mgmt_api_management/models/email_template_contract.rb' + autoload :GroupContract, '2018-01-01/generated/azure_mgmt_api_management/models/group_contract.rb' + autoload :UserContract, '2018-01-01/generated/azure_mgmt_api_management/models/user_contract.rb' + autoload :IdentityProviderContract, '2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_contract.rb' + autoload :NotificationContract, '2018-01-01/generated/azure_mgmt_api_management/models/notification_contract.rb' + autoload :RecipientUserContract, '2018-01-01/generated/azure_mgmt_api_management/models/recipient_user_contract.rb' + autoload :RecipientEmailContract, '2018-01-01/generated/azure_mgmt_api_management/models/recipient_email_contract.rb' + autoload :OpenidConnectProviderContract, '2018-01-01/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb' + autoload :PortalSigninSettings, '2018-01-01/generated/azure_mgmt_api_management/models/portal_signin_settings.rb' + autoload :PortalSignupSettings, '2018-01-01/generated/azure_mgmt_api_management/models/portal_signup_settings.rb' + autoload :PortalDelegationSettings, '2018-01-01/generated/azure_mgmt_api_management/models/portal_delegation_settings.rb' + autoload :SubscriptionContract, '2018-01-01/generated/azure_mgmt_api_management/models/subscription_contract.rb' + autoload :PropertyContract, '2018-01-01/generated/azure_mgmt_api_management/models/property_contract.rb' + autoload :TagContract, '2018-01-01/generated/azure_mgmt_api_management/models/tag_contract.rb' + autoload :TagDescriptionContract, '2018-01-01/generated/azure_mgmt_api_management/models/tag_description_contract.rb' + autoload :ApiVersionSetContract, '2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_contract.rb' + autoload :PolicyContentFormat, '2018-01-01/generated/azure_mgmt_api_management/models/policy_content_format.rb' + autoload :Protocol, '2018-01-01/generated/azure_mgmt_api_management/models/protocol.rb' + autoload :ContentFormat, '2018-01-01/generated/azure_mgmt_api_management/models/content_format.rb' + autoload :SoapApiType, '2018-01-01/generated/azure_mgmt_api_management/models/soap_api_type.rb' + autoload :ApiType, '2018-01-01/generated/azure_mgmt_api_management/models/api_type.rb' + autoload :State, '2018-01-01/generated/azure_mgmt_api_management/models/state.rb' + autoload :LoggerType, '2018-01-01/generated/azure_mgmt_api_management/models/logger_type.rb' + autoload :ProductState, '2018-01-01/generated/azure_mgmt_api_management/models/product_state.rb' + autoload :GrantType, '2018-01-01/generated/azure_mgmt_api_management/models/grant_type.rb' + autoload :AuthorizationMethod, '2018-01-01/generated/azure_mgmt_api_management/models/authorization_method.rb' + autoload :ClientAuthenticationMethod, '2018-01-01/generated/azure_mgmt_api_management/models/client_authentication_method.rb' + autoload :BearerTokenSendingMethod, '2018-01-01/generated/azure_mgmt_api_management/models/bearer_token_sending_method.rb' + autoload :BackendProtocol, '2018-01-01/generated/azure_mgmt_api_management/models/backend_protocol.rb' + autoload :HostnameType, '2018-01-01/generated/azure_mgmt_api_management/models/hostname_type.rb' + autoload :SkuType, '2018-01-01/generated/azure_mgmt_api_management/models/sku_type.rb' + autoload :VirtualNetworkType, '2018-01-01/generated/azure_mgmt_api_management/models/virtual_network_type.rb' + autoload :NameAvailabilityReason, '2018-01-01/generated/azure_mgmt_api_management/models/name_availability_reason.rb' + autoload :GroupType, '2018-01-01/generated/azure_mgmt_api_management/models/group_type.rb' + autoload :Confirmation, '2018-01-01/generated/azure_mgmt_api_management/models/confirmation.rb' + autoload :UserState, '2018-01-01/generated/azure_mgmt_api_management/models/user_state.rb' + autoload :IdentityProviderType, '2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_type.rb' + autoload :ConnectivityStatusType, '2018-01-01/generated/azure_mgmt_api_management/models/connectivity_status_type.rb' + autoload :SubscriptionState, '2018-01-01/generated/azure_mgmt_api_management/models/subscription_state.rb' + autoload :AsyncOperationStatus, '2018-01-01/generated/azure_mgmt_api_management/models/async_operation_status.rb' + autoload :KeyType, '2018-01-01/generated/azure_mgmt_api_management/models/key_type.rb' + autoload :VersioningScheme, '2018-01-01/generated/azure_mgmt_api_management/models/versioning_scheme.rb' + autoload :TemplateName, '2018-01-01/generated/azure_mgmt_api_management/models/template_name.rb' + autoload :NotificationName, '2018-01-01/generated/azure_mgmt_api_management/models/notification_name.rb' + autoload :PolicyScopeContract, '2018-01-01/generated/azure_mgmt_api_management/models/policy_scope_contract.rb' + autoload :ExportFormat, '2018-01-01/generated/azure_mgmt_api_management/models/export_format.rb' + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api.rb new file mode 100644 index 0000000000..be18ebe8bf --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api.rb @@ -0,0 +1,1099 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Api + include MsRestAzure + + # + # Creates and initializes a new instance of the Api class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all APIs of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param expand_api_version_set [Boolean] Include full ApiVersionSet resource + # in response + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_api_version_set = false, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, expand_api_version_set, custom_headers) + first_page.get_all_items + end + + # + # Lists all APIs of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param expand_api_version_set [Boolean] Include full ApiVersionSet resource + # in response + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_api_version_set = false, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, expand_api_version_set, custom_headers).value! + end + + # + # Lists all APIs of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param expand_api_version_set [Boolean] Include full ApiVersionSet resource + # in response + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_api_version_set = false, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'api-version' => @client.api_version,'expandApiVersionSet' => expand_api_version_set}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiCollection.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 + + # + # Gets the entity state (Etag) version of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiContract] operation results. + # + def get(resource_group_name, service_name, api_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, custom_headers).value! + end + + # + # Gets the details of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def get_async(resource_group_name, service_name, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiContract.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 + + # + # Creates new or updates existing specified API of the API Management service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [ApiCreateOrUpdateParameter] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates new or updates existing specified API of the API Management service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [ApiCreateOrUpdateParameter] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! + end + + # + # Creates new or updates existing specified API of the API Management service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [ApiCreateOrUpdateParameter] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiCreateOrUpdateParameter.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiContract.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 + + # + # Updates the specified API of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [ApiUpdateContract] API Update Contract parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the specified API of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [ApiUpdateContract] API Update Contract parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the specified API of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [ApiUpdateContract] API Update Contract parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiUpdateContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'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 == 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 + end + + promise.execute + end + + # + # Deletes the specified API of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_revisions [Boolean] Delete all revisions of the Api. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, if_match, delete_revisions = nil, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, if_match, delete_revisions, custom_headers).value! + nil + end + + # + # Deletes the specified API of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_revisions [Boolean] Delete all revisions of the Api. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, if_match, delete_revisions = nil, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, if_match, delete_revisions, custom_headers).value! + end + + # + # Deletes the specified API of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_revisions [Boolean] Delete all revisions of the Api. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, if_match, delete_revisions = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'deleteRevisions' => delete_revisions,'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 + end + + promise.execute + end + + # + # Lists a collection of apis associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | isCurrent | eq | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_tags(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_tags_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of apis associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | isCurrent | eq | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_tags_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_tags_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of apis associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | isCurrent | eq | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_tags_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apisByTags' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagResourceCollection.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 + + # + # Lists all APIs of the API Management service instance. + # + # @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 [ApiCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all APIs of the API Management service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all APIs of the API Management service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiCollection.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 + + # + # Lists a collection of apis associated with tags. + # + # @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 [TagResourceCollection] operation results. + # + def list_by_tags_next(next_page_link, custom_headers = nil) + response = list_by_tags_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of apis associated with tags. + # + # @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. + # + def list_by_tags_next_with_http_info(next_page_link, custom_headers = nil) + list_by_tags_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of apis associated with tags. + # + # @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. + # + def list_by_tags_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagResourceCollection.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 + + # + # Lists all APIs of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param expand_api_version_set [Boolean] Include full ApiVersionSet resource + # in response + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiCollection] which provide lazy access to pages of the response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_api_version_set = false, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, expand_api_version_set, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists a collection of apis associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | isCurrent | eq | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagResourceCollection] which provide lazy access to pages of the + # response. + # + def list_by_tags_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_tags_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_tags_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_diagnostic.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_diagnostic.rb new file mode 100644 index 0000000000..16e77d7d7c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_diagnostic.rb @@ -0,0 +1,818 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiDiagnostic + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiDiagnostic class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all diagnostics of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all diagnostics of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all diagnostics of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticCollection.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 + + # + # Gets the entity state (Etag) version of the Diagnostic for an API specified + # by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, diagnostic_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, diagnostic_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the Diagnostic for an API specified + # by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, diagnostic_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the Diagnostic for an API specified + # by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, diagnostic_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'diagnosticId' => diagnostic_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the Diagnostic for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiagnosticContract] operation results. + # + def get(resource_group_name, service_name, api_id, diagnostic_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, diagnostic_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the Diagnostic for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, diagnostic_id, custom_headers).value! + end + + # + # Gets the details of the Diagnostic for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, api_id, diagnostic_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'diagnosticId' => diagnostic_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.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 + + # + # Creates a new Diagnostic for an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiagnosticContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a new Diagnostic for an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match, custom_headers).value! + end + + # + # Creates a new Diagnostic for an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'diagnosticId' => diagnostic_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.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 + + # + # Updates the details of the Diagnostic for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Diagnostic Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the Diagnostic for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Diagnostic Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the Diagnostic for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Diagnostic Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, api_id, diagnostic_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'diagnosticId' => diagnostic_id,'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 == 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 + end + + promise.execute + end + + # + # Deletes the specified Diagnostic from an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, diagnostic_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, diagnostic_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified Diagnostic from an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, diagnostic_id, if_match, custom_headers).value! + end + + # + # Deletes the specified Diagnostic from an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, diagnostic_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'diagnosticId' => diagnostic_id,'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 + end + + promise.execute + end + + # + # Lists all diagnostics of an API. + # + # @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 [DiagnosticCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all diagnostics of an API. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all diagnostics of an API. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticCollection.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 + + # + # Lists all diagnostics of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiagnosticCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_diagnostic_logger.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_diagnostic_logger.rb new file mode 100644 index 0000000000..edc4bd094b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_diagnostic_logger.rb @@ -0,0 +1,600 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiDiagnosticLogger + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiDiagnosticLogger class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all loggers assosiated with the specified Diagnostic of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | type | eq | | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, api_id, diagnostic_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, api_id, diagnostic_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all loggers assosiated with the specified Diagnostic of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | type | eq | | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, api_id, diagnostic_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all loggers assosiated with the specified Diagnostic of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | type | eq | | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, api_id, diagnostic_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id,'diagnosticId' => diagnostic_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerCollection.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 + + # + # Checks that logger entity specified by identifier is associated with the + # diagnostics entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_entity_exists(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + response = check_entity_exists_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers).value! + response.body unless response.nil? + end + + # + # Checks that logger entity specified by identifier is associated with the + # diagnostics entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def check_entity_exists_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + check_entity_exists_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers).value! + end + + # + # Checks that logger entity specified by identifier is associated with the + # diagnostics entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def check_entity_exists_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'diagnosticId' => diagnostic_id,'loggerid' => loggerid,'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(:head, 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 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 204) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Attaches a logger to a dignostic for an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LoggerContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers).value! + response.body unless response.nil? + end + + # + # Attaches a logger to a dignostic for an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers).value! + end + + # + # Attaches a logger to a dignostic for an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'diagnosticId' => diagnostic_id,'loggerid' => loggerid,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerContract.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 + + # + # Deletes the specified Logger from Diagnostic for an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers).value! + nil + end + + # + # Deletes the specified Logger from Diagnostic for an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers).value! + end + + # + # Deletes the specified Logger from Diagnostic for an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, diagnostic_id, loggerid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'diagnosticId' => diagnostic_id,'loggerid' => loggerid,'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 + end + + promise.execute + end + + # + # Lists all loggers assosiated with the specified Diagnostic of an API. + # + # @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 [LoggerCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all loggers assosiated with the specified Diagnostic of an API. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all loggers assosiated with the specified Diagnostic of an API. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerCollection.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 + + # + # Lists all loggers assosiated with the specified Diagnostic of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | type | eq | | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LoggerCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, api_id, diagnostic_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, api_id, diagnostic_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_export.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_export.rb new file mode 100644 index 0000000000..17ea970102 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_export.rb @@ -0,0 +1,140 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiExport + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiExport class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the details of the API specified by its identifier in the format + # specified to the Storage Blob with SAS Key valid for 5 minutes. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param format [ExportFormat] Format in which to export the Api Details to the + # Storage Blob with Sas Key valid for 5 minutes. Possible values include: + # 'Swagger', 'Wsdl', 'Wadl' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiExportResult] operation results. + # + def get(resource_group_name, service_name, api_id, format, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, format, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the API specified by its identifier in the format + # specified to the Storage Blob with SAS Key valid for 5 minutes. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param format [ExportFormat] Format in which to export the Api Details to the + # Storage Blob with Sas Key valid for 5 minutes. Possible values include: + # 'Swagger', 'Wsdl', 'Wadl' + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, format, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, format, custom_headers).value! + end + + # + # Gets the details of the API specified by its identifier in the format + # specified to the Storage Blob with SAS Key valid for 5 minutes. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param format [ExportFormat] Format in which to export the Api Details to the + # Storage Blob with Sas Key valid for 5 minutes. Possible values include: + # 'Swagger', 'Wsdl', 'Wadl' + # @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. + # + def get_async(resource_group_name, service_name, api_id, format, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'format is nil' if format.nil? + export = 'true' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'format' => format,'export' => export,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiExportResult.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 + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue.rb new file mode 100644 index 0000000000..d5b7dcffb3 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue.rb @@ -0,0 +1,714 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiIssue + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiIssue class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all issues assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | state | eq | | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all issues assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | state | eq | | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all issues assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | state | eq | | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueCollection.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 + + # + # Gets the entity state (Etag) version of the Issue for an API specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, issue_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the Issue for an API specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, issue_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the Issue for an API specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the Issue for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueContract] operation results. + # + def get(resource_group_name, service_name, api_id, issue_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, issue_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the Issue for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, issue_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, issue_id, custom_headers).value! + end + + # + # Gets the details of the Issue for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, api_id, issue_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueContract.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 + + # + # Creates a new Issue for an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param parameters [IssueContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, issue_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, issue_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a new Issue for an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param parameters [IssueContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, issue_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, issue_id, parameters, if_match, custom_headers).value! + end + + # + # Creates a new Issue for an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param parameters [IssueContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, issue_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueContract.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 + + # + # Deletes the specified Issue from an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, issue_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, issue_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified Issue from an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, issue_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, issue_id, if_match, custom_headers).value! + end + + # + # Deletes the specified Issue from an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, issue_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'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 + end + + promise.execute + end + + # + # Lists all issues assosiated with the specified API. + # + # @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 [IssueCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all issues assosiated with the specified API. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all issues assosiated with the specified API. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueCollection.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 + + # + # Lists all issues assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | state | eq | | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueCollection] which provide lazy access to pages of the response. + # + def list_by_service_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue_attachment.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue_attachment.rb new file mode 100644 index 0000000000..4fdcf56969 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue_attachment.rb @@ -0,0 +1,751 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiIssueAttachment + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiIssueAttachment class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, api_id, issue_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, api_id, issue_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, api_id, issue_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, api_id, issue_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, api_id, issue_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueAttachmentCollection.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 + + # + # Gets the entity state (Etag) version of the issue Attachment for an API + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the issue Attachment for an API + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the issue Attachment for an API + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'attachment_id is nil' if attachment_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'attachmentId' => attachment_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the issue Attachment for an API specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueAttachmentContract] operation results. + # + def get(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the issue Attachment for an API specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers).value! + end + + # + # Gets the details of the issue Attachment for an API specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @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. + # + def get_async(resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'attachment_id is nil' if attachment_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'attachmentId' => attachment_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueAttachmentContract.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 + + # + # Creates a new Attachment for the Issue in an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @param parameters [IssueAttachmentContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueAttachmentContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, issue_id, attachment_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, issue_id, attachment_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a new Attachment for the Issue in an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @param parameters [IssueAttachmentContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, issue_id, attachment_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, issue_id, attachment_id, parameters, if_match, custom_headers).value! + end + + # + # Creates a new Attachment for the Issue in an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @param parameters [IssueAttachmentContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, issue_id, attachment_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'attachment_id is nil' if attachment_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueAttachmentContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'attachmentId' => attachment_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueAttachmentContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueAttachmentContract.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 + + # + # Deletes the specified comment from an Issue. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, issue_id, attachment_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, issue_id, attachment_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified comment from an Issue. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, issue_id, attachment_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, issue_id, attachment_id, if_match, custom_headers).value! + end + + # + # Deletes the specified comment from an Issue. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param attachment_id [String] Attachment identifier within an Issue. Must be + # unique in the current Issue. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, issue_id, attachment_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'attachment_id is nil' if attachment_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'attachmentId' => attachment_id,'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 + end + + promise.execute + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @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 [IssueAttachmentCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueAttachmentCollection.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 + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueAttachmentCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, api_id, issue_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, api_id, issue_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue_comment.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue_comment.rb new file mode 100644 index 0000000000..aee3b4cbc7 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_issue_comment.rb @@ -0,0 +1,748 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiIssueComment + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiIssueComment class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, api_id, issue_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, api_id, issue_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, api_id, issue_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, api_id, issue_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, api_id, issue_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueCommentCollection.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 + + # + # Gets the entity state (Etag) version of the issue Comment for an API + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the issue Comment for an API + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the issue Comment for an API + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'comment_id is nil' if comment_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'commentId' => comment_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the issue Comment for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueCommentContract] operation results. + # + def get(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the issue Comment for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers).value! + end + + # + # Gets the details of the issue Comment for an API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @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. + # + def get_async(resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'comment_id is nil' if comment_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'commentId' => comment_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueCommentContract.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 + + # + # Creates a new Comment for the Issue in an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @param parameters [IssueCommentContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueCommentContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, issue_id, comment_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, issue_id, comment_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a new Comment for the Issue in an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @param parameters [IssueCommentContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, issue_id, comment_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, issue_id, comment_id, parameters, if_match, custom_headers).value! + end + + # + # Creates a new Comment for the Issue in an API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @param parameters [IssueCommentContract] Create parameters. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, issue_id, comment_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'comment_id is nil' if comment_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueCommentContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'commentId' => comment_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueCommentContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueCommentContract.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 + + # + # Deletes the specified comment from an Issue. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, issue_id, comment_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, issue_id, comment_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified comment from an Issue. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, issue_id, comment_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, issue_id, comment_id, if_match, custom_headers).value! + end + + # + # Deletes the specified comment from an Issue. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param comment_id [String] Comment identifier within an Issue. Must be unique + # in the current Issue. + # @param if_match [String] ETag of the Issue Entity. ETag should match the + # current entity state from the header response of the GET request or it should + # be * for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, issue_id, comment_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'issue_id is nil' if issue_id.nil? + fail ArgumentError, 'comment_id is nil' if comment_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'issueId' => issue_id,'commentId' => comment_id,'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 + end + + promise.execute + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @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 [IssueCommentCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IssueCommentCollection.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 + + # + # Lists all comments for the Issue assosiated with the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param issue_id [String] Issue identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IssueCommentCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, api_id, issue_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, api_id, issue_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_client.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_client.rb new file mode 100644 index 0000000000..ccbfb6204d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_client.rb @@ -0,0 +1,363 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # A service client - single point of access to the REST API. + # + class ApiManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] Version of the API to be used with the client request. + attr_reader :api_version + + # @return [String] Subscription credentials which uniquely identify + # Microsoft Azure subscription. The subscription ID forms part of the URI + # for every service call. + attr_accessor :subscription_id + + # @return [String] Gets or sets the preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] Gets or sets the retry timeout in seconds for Long + # Running Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] When set to true a unique x-ms-client-request-id value + # is generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [Policy] policy + attr_reader :policy + + # @return [PolicySnippets] policy_snippets + attr_reader :policy_snippets + + # @return [Regions] regions + attr_reader :regions + + # @return [Api] api + attr_reader :api + + # @return [ApiRevisions] api_revisions + attr_reader :api_revisions + + # @return [ApiRelease] api_release + attr_reader :api_release + + # @return [ApiOperation] api_operation + attr_reader :api_operation + + # @return [ApiOperationPolicy] api_operation_policy + attr_reader :api_operation_policy + + # @return [ApiProduct] api_product + attr_reader :api_product + + # @return [ApiPolicy] api_policy + attr_reader :api_policy + + # @return [ApiSchema] api_schema + attr_reader :api_schema + + # @return [ApiDiagnostic] api_diagnostic + attr_reader :api_diagnostic + + # @return [ApiDiagnosticLogger] api_diagnostic_logger + attr_reader :api_diagnostic_logger + + # @return [ApiIssue] api_issue + attr_reader :api_issue + + # @return [ApiIssueComment] api_issue_comment + attr_reader :api_issue_comment + + # @return [ApiIssueAttachment] api_issue_attachment + attr_reader :api_issue_attachment + + # @return [AuthorizationServer] authorization_server + attr_reader :authorization_server + + # @return [Backend] backend + attr_reader :backend + + # @return [Certificate] certificate + attr_reader :certificate + + # @return [ApiManagementOperations] api_management_operations + attr_reader :api_management_operations + + # @return [ApiManagementService] api_management_service + attr_reader :api_management_service + + # @return [Diagnostic] diagnostic + attr_reader :diagnostic + + # @return [DiagnosticLogger] diagnostic_logger + attr_reader :diagnostic_logger + + # @return [EmailTemplate] email_template + attr_reader :email_template + + # @return [Group] group + attr_reader :group + + # @return [GroupUser] group_user + attr_reader :group_user + + # @return [IdentityProvider] identity_provider + attr_reader :identity_provider + + # @return [Logger] logger + attr_reader :logger + + # @return [Notification] notification + attr_reader :notification + + # @return [NotificationRecipientUser] notification_recipient_user + attr_reader :notification_recipient_user + + # @return [NotificationRecipientEmail] notification_recipient_email + attr_reader :notification_recipient_email + + # @return [NetworkStatus] network_status + attr_reader :network_status + + # @return [OpenIdConnectProvider] open_id_connect_provider + attr_reader :open_id_connect_provider + + # @return [SignInSettings] sign_in_settings + attr_reader :sign_in_settings + + # @return [SignUpSettings] sign_up_settings + attr_reader :sign_up_settings + + # @return [DelegationSettings] delegation_settings + attr_reader :delegation_settings + + # @return [Product] product + attr_reader :product + + # @return [ProductApi] product_api + attr_reader :product_api + + # @return [ProductGroup] product_group + attr_reader :product_group + + # @return [ProductSubscriptions] product_subscriptions + attr_reader :product_subscriptions + + # @return [ProductPolicy] product_policy + attr_reader :product_policy + + # @return [Property] property + attr_reader :property + + # @return [QuotaByCounterKeys] quota_by_counter_keys + attr_reader :quota_by_counter_keys + + # @return [QuotaByPeriodKeys] quota_by_period_keys + attr_reader :quota_by_period_keys + + # @return [Reports] reports + attr_reader :reports + + # @return [Subscription] subscription + attr_reader :subscription + + # @return [TagResource] tag_resource + attr_reader :tag_resource + + # @return [Tag] tag + attr_reader :tag + + # @return [TagDescription] tag_description + attr_reader :tag_description + + # @return [OperationOperations] operation_operations + attr_reader :operation_operations + + # @return [TenantAccess] tenant_access + attr_reader :tenant_access + + # @return [TenantAccessGit] tenant_access_git + attr_reader :tenant_access_git + + # @return [TenantConfiguration] tenant_configuration + attr_reader :tenant_configuration + + # @return [User] user + attr_reader :user + + # @return [UserGroup] user_group + attr_reader :user_group + + # @return [UserSubscription] user_subscription + attr_reader :user_subscription + + # @return [UserIdentities] user_identities + attr_reader :user_identities + + # @return [ApiVersionSet] api_version_set + attr_reader :api_version_set + + # @return [ApiExport] api_export + attr_reader :api_export + + # + # Creates initializes a new instance of the ApiManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @policy = Policy.new(self) + @policy_snippets = PolicySnippets.new(self) + @regions = Regions.new(self) + @api = Api.new(self) + @api_revisions = ApiRevisions.new(self) + @api_release = ApiRelease.new(self) + @api_operation = ApiOperation.new(self) + @api_operation_policy = ApiOperationPolicy.new(self) + @api_product = ApiProduct.new(self) + @api_policy = ApiPolicy.new(self) + @api_schema = ApiSchema.new(self) + @api_diagnostic = ApiDiagnostic.new(self) + @api_diagnostic_logger = ApiDiagnosticLogger.new(self) + @api_issue = ApiIssue.new(self) + @api_issue_comment = ApiIssueComment.new(self) + @api_issue_attachment = ApiIssueAttachment.new(self) + @authorization_server = AuthorizationServer.new(self) + @backend = Backend.new(self) + @certificate = Certificate.new(self) + @api_management_operations = ApiManagementOperations.new(self) + @api_management_service = ApiManagementService.new(self) + @diagnostic = Diagnostic.new(self) + @diagnostic_logger = DiagnosticLogger.new(self) + @email_template = EmailTemplate.new(self) + @group = Group.new(self) + @group_user = GroupUser.new(self) + @identity_provider = IdentityProvider.new(self) + @logger = Logger.new(self) + @notification = Notification.new(self) + @notification_recipient_user = NotificationRecipientUser.new(self) + @notification_recipient_email = NotificationRecipientEmail.new(self) + @network_status = NetworkStatus.new(self) + @open_id_connect_provider = OpenIdConnectProvider.new(self) + @sign_in_settings = SignInSettings.new(self) + @sign_up_settings = SignUpSettings.new(self) + @delegation_settings = DelegationSettings.new(self) + @product = Product.new(self) + @product_api = ProductApi.new(self) + @product_group = ProductGroup.new(self) + @product_subscriptions = ProductSubscriptions.new(self) + @product_policy = ProductPolicy.new(self) + @property = Property.new(self) + @quota_by_counter_keys = QuotaByCounterKeys.new(self) + @quota_by_period_keys = QuotaByPeriodKeys.new(self) + @reports = Reports.new(self) + @subscription = Subscription.new(self) + @tag_resource = TagResource.new(self) + @tag = Tag.new(self) + @tag_description = TagDescription.new(self) + @operation_operations = OperationOperations.new(self) + @tenant_access = TenantAccess.new(self) + @tenant_access_git = TenantAccessGit.new(self) + @tenant_configuration = TenantConfiguration.new(self) + @user = User.new(self) + @user_group = UserGroup.new(self) + @user_subscription = UserSubscription.new(self) + @user_identities = UserIdentities.new(self) + @api_version_set = ApiVersionSet.new(self) + @api_export = ApiExport.new(self) + @api_version = '2018-01-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_api_management' + if defined? Azure::ApiManagement::Mgmt::V2018_01_01_preview::VERSION + sdk_information = "#{sdk_information}/#{Azure::ApiManagement::Mgmt::V2018_01_01_preview::VERSION}" + end + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_operations.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_operations.rb new file mode 100644 index 0000000000..e16bba260c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_operations.rb @@ -0,0 +1,220 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiManagementOperations + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiManagementOperations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all of the available REST API operations of the Microsoft.ApiManagement + # provider. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Lists all of the available REST API operations of the Microsoft.ApiManagement + # provider. + # + # @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. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Lists all of the available REST API operations of the Microsoft.ApiManagement + # provider. + # + # @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. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # 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 = 'providers/Microsoft.ApiManagement/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationListResult.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 + + # + # Lists all of the available REST API operations of the Microsoft.ApiManagement + # provider. + # + # @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 [OperationListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all of the available REST API operations of the Microsoft.ApiManagement + # provider. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all of the available REST API operations of the Microsoft.ApiManagement + # provider. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationListResult.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 + + # + # Lists all of the available REST API operations of the Microsoft.ApiManagement + # provider. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_service.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_service.rb new file mode 100644 index 0000000000..550cd83fbe --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_management_service.rb @@ -0,0 +1,1885 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiManagementService + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiManagementService class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Restores a backup of an API Management service created using the + # ApiManagementService_Backup operation on the current service. This is a long + # running operation and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the Restore API Management service from backup operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def restore(resource_group_name, service_name, parameters, custom_headers = nil) + response = restore_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the Restore API Management service from backup operation. + # @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. + # + def restore_async(resource_group_name, service_name, parameters, custom_headers = nil) + # Send request + promise = begin_restore_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Creates a backup of the API Management service to the given Azure Storage + # Account. This is long running operation and could take several minutes to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the ApiManagementService_Backup operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def backup(resource_group_name, service_name, parameters, custom_headers = nil) + response = backup_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the ApiManagementService_Backup operation. + # @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. + # + def backup_async(resource_group_name, service_name, parameters, custom_headers = nil) + # Send request + promise = begin_backup_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Creates or updates an API Management service. This is long running operation + # and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceResource] Parameters supplied to the + # CreateOrUpdate API Management service operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def create_or_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceResource] Parameters supplied to the + # CreateOrUpdate API Management service operation. + # @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. + # + def create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Updates an existing API Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateParameters] Parameters supplied + # to the CreateOrUpdate API Management service operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def update(resource_group_name, service_name, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateParameters] Parameters supplied + # to the CreateOrUpdate API Management service operation. + # @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. + # + def update_async(resource_group_name, service_name, parameters, custom_headers = nil) + # Send request + promise = begin_update_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Gets an API Management service resource description. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets an API Management service resource description. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets an API Management service resource description. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Deletes an existing API Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, custom_headers = nil) + response = delete_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Deletes an existing API Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, custom_headers = nil) + delete_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Deletes an existing API Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def delete_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # List all API Management services within a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers) + first_page.get_all_items + end + + # + # List all API Management services within a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @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. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) + list_by_resource_group_async(resource_group_name, custom_headers).value! + end + + # + # List all API Management services within a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @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. + # + 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, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service' + + 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceListResult.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 + + # + # Lists all API Management services within an Azure subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Lists all API Management services within an Azure 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. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Lists all API Management services within an Azure 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. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service' + + 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceListResult.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 + + # + # Gets the Single-Sign-On token for the API Management Service which is valid + # for 5 Minutes. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceGetSsoTokenResult] operation results. + # + def get_sso_token(resource_group_name, service_name, custom_headers = nil) + response = get_sso_token_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Single-Sign-On token for the API Management Service which is valid + # for 5 Minutes. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_sso_token_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_sso_token_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets the Single-Sign-On token for the API Management Service which is valid + # for 5 Minutes. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_sso_token_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/getssotoken' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceGetSsoTokenResult.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 + + # + # Checks availability and correctness of a name for an API Management service. + # + # @param parameters [ApiManagementServiceCheckNameAvailabilityParameters] + # Parameters supplied to the CheckNameAvailability operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceNameAvailabilityResult] operation results. + # + def check_name_availability(parameters, custom_headers = nil) + response = check_name_availability_async(parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Checks availability and correctness of a name for an API Management service. + # + # @param parameters [ApiManagementServiceCheckNameAvailabilityParameters] + # Parameters supplied to the CheckNameAvailability 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. + # + def check_name_availability_with_http_info(parameters, custom_headers = nil) + check_name_availability_async(parameters, custom_headers).value! + end + + # + # Checks availability and correctness of a name for an API Management service. + # + # @param parameters [ApiManagementServiceCheckNameAvailabilityParameters] + # Parameters supplied to the CheckNameAvailability 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. + # + def check_name_availability_async(parameters, custom_headers = nil) + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceCheckNameAvailabilityParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceNameAvailabilityResult.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 + + # + # Updates the Microsoft.ApiManagement resource running in the Virtual network + # to pick the updated network settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceApplyNetworkConfigurationParameters] + # Parameters supplied to the Apply Network Configuration operation. If the + # parameters are empty, all the regions in which the Api Management service is + # deployed will be updated sequentially without incurring downtime in the + # region. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def apply_network_configuration_updates(resource_group_name, service_name, parameters = nil, custom_headers = nil) + response = apply_network_configuration_updates_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceApplyNetworkConfigurationParameters] + # Parameters supplied to the Apply Network Configuration operation. If the + # parameters are empty, all the regions in which the Api Management service is + # deployed will be updated sequentially without incurring downtime in the + # region. + # @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. + # + def apply_network_configuration_updates_async(resource_group_name, service_name, parameters = nil, custom_headers = nil) + # Send request + promise = begin_apply_network_configuration_updates_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Upload Custom Domain SSL certificate for an API Management service. This + # operation will be deprecated in future releases. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUploadCertificateParameters] + # Parameters supplied to the Upload SSL certificate for an API Management + # service operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CertificateInformation] operation results. + # + def upload_certificate(resource_group_name, service_name, parameters, custom_headers = nil) + response = upload_certificate_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Upload Custom Domain SSL certificate for an API Management service. This + # operation will be deprecated in future releases. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUploadCertificateParameters] + # Parameters supplied to the Upload SSL certificate for an API Management + # service 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. + # + def upload_certificate_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + upload_certificate_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Upload Custom Domain SSL certificate for an API Management service. This + # operation will be deprecated in future releases. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUploadCertificateParameters] + # Parameters supplied to the Upload SSL certificate for an API Management + # service 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. + # + def upload_certificate_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceUploadCertificateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatecertificate' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::CertificateInformation.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 + + # + # Creates, updates, or deletes the custom hostnames for an API Management + # service. The custom hostname can be applied to the Proxy and Portal endpoint. + # This is a long running operation and could take several minutes to complete. + # This operation will be deprecated in the next version update. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateHostnameParameters] Parameters + # supplied to the UpdateHostname operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def update_hostname(resource_group_name, service_name, parameters, custom_headers = nil) + response = update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateHostnameParameters] Parameters + # supplied to the UpdateHostname operation. + # @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. + # + def update_hostname_async(resource_group_name, service_name, parameters, custom_headers = nil) + # Send request + promise = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Restores a backup of an API Management service created using the + # ApiManagementService_Backup operation on the current service. This is a long + # running operation and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the Restore API Management service from backup operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def begin_restore(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_restore_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Restores a backup of an API Management service created using the + # ApiManagementService_Backup operation on the current service. This is a long + # running operation and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the Restore API Management service from backup 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. + # + def begin_restore_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_restore_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Restores a backup of an API Management service created using the + # ApiManagementService_Backup operation on the current service. This is a long + # running operation and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the Restore API Management service from backup 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. + # + def begin_restore_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceBackupRestoreParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Creates a backup of the API Management service to the given Azure Storage + # Account. This is long running operation and could take several minutes to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the ApiManagementService_Backup operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def begin_backup(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_backup_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a backup of the API Management service to the given Azure Storage + # Account. This is long running operation and could take several minutes to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the ApiManagementService_Backup 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. + # + def begin_backup_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_backup_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Creates a backup of the API Management service to the given Azure Storage + # Account. This is long running operation and could take several minutes to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters + # supplied to the ApiManagementService_Backup 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. + # + def begin_backup_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceBackupRestoreParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Creates or updates an API Management service. This is long running operation + # and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceResource] Parameters supplied to the + # CreateOrUpdate API Management service operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def begin_create_or_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates an API Management service. This is long running operation + # and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceResource] Parameters supplied to the + # CreateOrUpdate API Management service 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. + # + def begin_create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Creates or updates an API Management service. This is long running operation + # and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceResource] Parameters supplied to the + # CreateOrUpdate API Management service 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. + # + def begin_create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 == 202 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Updates an existing API Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateParameters] Parameters supplied + # to the CreateOrUpdate API Management service operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def begin_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_update_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates an existing API Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateParameters] Parameters supplied + # to the CreateOrUpdate API Management service 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. + # + def begin_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_update_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Updates an existing API Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateParameters] Parameters supplied + # to the CreateOrUpdate API Management service 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. + # + def begin_update_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Updates the Microsoft.ApiManagement resource running in the Virtual network + # to pick the updated network settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceApplyNetworkConfigurationParameters] + # Parameters supplied to the Apply Network Configuration operation. If the + # parameters are empty, all the regions in which the Api Management service is + # deployed will be updated sequentially without incurring downtime in the + # region. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def begin_apply_network_configuration_updates(resource_group_name, service_name, parameters = nil, custom_headers = nil) + response = begin_apply_network_configuration_updates_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates the Microsoft.ApiManagement resource running in the Virtual network + # to pick the updated network settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceApplyNetworkConfigurationParameters] + # Parameters supplied to the Apply Network Configuration operation. If the + # parameters are empty, all the regions in which the Api Management service is + # deployed will be updated sequentially without incurring downtime in the + # region. + # @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. + # + def begin_apply_network_configuration_updates_with_http_info(resource_group_name, service_name, parameters = nil, custom_headers = nil) + begin_apply_network_configuration_updates_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Updates the Microsoft.ApiManagement resource running in the Virtual network + # to pick the updated network settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceApplyNetworkConfigurationParameters] + # Parameters supplied to the Apply Network Configuration operation. If the + # parameters are empty, all the regions in which the Api Management service is + # deployed will be updated sequentially without incurring downtime in the + # region. + # @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. + # + def begin_apply_network_configuration_updates_async(resource_group_name, service_name, parameters = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceApplyNetworkConfigurationParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 + + # + # Creates, updates, or deletes the custom hostnames for an API Management + # service. The custom hostname can be applied to the Proxy and Portal endpoint. + # This is a long running operation and could take several minutes to complete. + # This operation will be deprecated in the next version update. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateHostnameParameters] Parameters + # supplied to the UpdateHostname operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceResource] operation results. + # + def begin_update_hostname(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates, updates, or deletes the custom hostnames for an API Management + # service. The custom hostname can be applied to the Proxy and Portal endpoint. + # This is a long running operation and could take several minutes to complete. + # This operation will be deprecated in the next version update. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateHostnameParameters] Parameters + # supplied to the UpdateHostname 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. + # + def begin_update_hostname_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Creates, updates, or deletes the custom hostnames for an API Management + # service. The custom hostname can be applied to the Proxy and Portal endpoint. + # This is a long running operation and could take several minutes to complete. + # This operation will be deprecated in the next version update. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [ApiManagementServiceUpdateHostnameParameters] Parameters + # supplied to the UpdateHostname 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. + # + def begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceUpdateHostnameParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatehostname' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 == 202 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceResource.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 all API Management services within 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 [ApiManagementServiceListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List all API Management services within 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. + # + 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).value! + end + + # + # List all API Management services within 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. + # + 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 = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceListResult.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 + + # + # Lists all API Management services within an Azure 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 [ApiManagementServiceListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all API Management services within an Azure 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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all API Management services within an Azure 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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiManagementServiceListResult.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 all API Management services within a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceListResult] which provide lazy access to pages + # of the response. + # + def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, 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) + end + page + end + end + + # + # Lists all API Management services within an Azure subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiManagementServiceListResult] which provide lazy access to pages + # of the response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_operation.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_operation.rb new file mode 100644 index 0000000000..74e3042aa2 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_operation.rb @@ -0,0 +1,849 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiOperation + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiOperation class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of the operations for the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_api(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of the operations for the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of the operations for the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_api_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationCollection.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 + + # + # Gets the entity state (Etag) version of the API operation specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the API operation specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the API operation specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the API Operation specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationContract] operation results. + # + def get(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the API Operation specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + end + + # + # Gets the details of the API Operation specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationContract.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 + + # + # Creates a new operation in the API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [OperationContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, operation_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a new operation in the API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [OperationContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! + end + + # + # Creates a new operation in the API or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [OperationContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationContract.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 + + # + # Updates the details of the operation in the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [OperationUpdateContract] API Operation Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the operation in the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [OperationUpdateContract] API Operation Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the operation in the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [OperationUpdateContract] API Operation Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationUpdateContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'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 == 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 + end + + promise.execute + end + + # + # Deletes the specified operation in the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified operation in the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! + end + + # + # Deletes the specified operation in the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'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 + end + + promise.execute + end + + # + # Lists a collection of the operations for the specified API. + # + # @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 [OperationCollection] operation results. + # + def list_by_api_next(next_page_link, custom_headers = nil) + response = list_by_api_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of the operations for the specified API. + # + # @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. + # + def list_by_api_next_with_http_info(next_page_link, custom_headers = nil) + list_by_api_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of the operations for the specified API. + # + # @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. + # + def list_by_api_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationCollection.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 + + # + # Lists a collection of the operations for the specified API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationCollection] which provide lazy access to pages of the + # response. + # + def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_api_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_operation_policy.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_operation_policy.rb new file mode 100644 index 0000000000..436a071a5e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_operation_policy.rb @@ -0,0 +1,591 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiOperationPolicy + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiOperationPolicy class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Get the list of policy configuration at the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyCollection] operation results. + # + def list_by_operation(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + response = list_by_operation_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the list of policy configuration at the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def list_by_operation_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + list_by_operation_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + end + + # + # Get the list of policy configuration at the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def list_by_operation_async(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyCollection.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 + + # + # Gets the entity state (Etag) version of the API operation policy specified by + # its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the API operation policy specified by + # its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the API operation policy specified by + # its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + policy_id = 'policy' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'policyId' => policy_id,'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(:head, 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 + end + + promise.execute + end + + # + # Get the policy configuration at the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyContract] operation results. + # + def get(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the policy configuration at the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, operation_id, custom_headers).value! + end + + # + # Get the policy configuration at the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, api_id, operation_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + policy_id = 'policy' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'policyId' => policy_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.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 + + # + # Creates or updates policy configuration for the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, operation_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates policy configuration for the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, operation_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or updates policy configuration for the API Operation level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, operation_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + policy_id = 'policy' + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'policyId' => policy_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.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 + + # + # Deletes the policy configuration at the Api Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the policy configuration at the Api Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers).value! + end + + # + # Deletes the policy configuration at the Api Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, operation_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + policy_id = 'policy' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'policyId' => policy_id,'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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_policy.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_policy.rb new file mode 100644 index 0000000000..d9981104e8 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_policy.rb @@ -0,0 +1,556 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiPolicy + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiPolicy class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Get the policy configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyCollection] operation results. + # + def list_by_api(resource_group_name, service_name, api_id, custom_headers = nil) + response = list_by_api_async(resource_group_name, service_name, api_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the policy configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def list_by_api_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + list_by_api_async(resource_group_name, service_name, api_id, custom_headers).value! + end + + # + # Get the policy configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def list_by_api_async(resource_group_name, service_name, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/policies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyCollection.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 + + # + # Gets the entity state (Etag) version of the API policy specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the API policy specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the API policy specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + policy_id = 'policy' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'policyId' => policy_id,'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(:head, 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 + end + + promise.execute + end + + # + # Get the policy configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyContract] operation results. + # + def get(resource_group_name, service_name, api_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the policy configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, custom_headers).value! + end + + # + # Get the policy configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def get_async(resource_group_name, service_name, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + policy_id = 'policy' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'policyId' => policy_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.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 + + # + # Creates or updates policy configuration for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates policy configuration for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or updates policy configuration for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + policy_id = 'policy' + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'policyId' => policy_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.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 + + # + # Deletes the policy configuration at the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the policy configuration at the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, if_match, custom_headers).value! + end + + # + # Deletes the policy configuration at the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + policy_id = 'policy' + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'policyId' => policy_id,'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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_product.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_product.rb new file mode 100644 index 0000000000..6c419032d0 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_product.rb @@ -0,0 +1,262 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiProduct + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiProduct class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all Products, which the API is part of. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_apis(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all Products, which the API is part of. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_apis_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_apis_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all Products, which the API is part of. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_apis_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/products' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductCollection.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 + + # + # Lists all Products, which the API is part of. + # + # @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 [ProductCollection] operation results. + # + def list_by_apis_next(next_page_link, custom_headers = nil) + response = list_by_apis_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all Products, which the API is part of. + # + # @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. + # + def list_by_apis_next_with_http_info(next_page_link, custom_headers = nil) + list_by_apis_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all Products, which the API is part of. + # + # @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. + # + def list_by_apis_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductCollection.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 + + # + # Lists all Products, which the API is part of. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ProductCollection] which provide lazy access to pages of the + # response. + # + def list_by_apis_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_apis_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_apis_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_release.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_release.rb new file mode 100644 index 0000000000..dc392377c9 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_release.rb @@ -0,0 +1,837 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiRelease + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiRelease class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all releases of an API. An API release is created when making an API + # Revision current. Releases are also used to rollback to previous revisions. + # Results will be paged and can be constrained by the $top and $skip + # parameters. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # |notes|ge le eq ne gt lt|substringof contains startswith endswith| + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all releases of an API. An API release is created when making an API + # Revision current. Releases are also used to rollback to previous revisions. + # Results will be paged and can be constrained by the $top and $skip + # parameters. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # |notes|ge le eq ne gt lt|substringof contains startswith endswith| + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all releases of an API. An API release is created when making an API + # Revision current. Releases are also used to rollback to previous revisions. + # Results will be paged and can be constrained by the $top and $skip + # parameters. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # |notes|ge le eq ne gt lt|substringof contains startswith endswith| + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/releases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiReleaseCollection.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 + + # + # Returns the etag of an API release. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, release_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, release_id, custom_headers).value! + nil + end + + # + # Returns the etag of an API release. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, release_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, release_id, custom_headers).value! + end + + # + # Returns the etag of an API release. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, release_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'release_id is nil' if release_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'apiId' => api_id,'releaseId' => release_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:head, 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 + end + + promise.execute + end + + # + # Returns the details of an API release. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiReleaseContract] operation results. + # + def get(resource_group_name, service_name, api_id, release_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, release_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Returns the details of an API release. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, release_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, release_id, custom_headers).value! + end + + # + # Returns the details of an API release. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, api_id, release_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'release_id is nil' if release_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'apiId' => api_id,'releaseId' => release_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiReleaseContract.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 + + # + # Creates a new Release for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param parameters [ApiReleaseContract] Create parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiReleaseContract] operation results. + # + def create(resource_group_name, service_name, api_id, release_id, parameters, custom_headers = nil) + response = create_async(resource_group_name, service_name, api_id, release_id, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a new Release for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param parameters [ApiReleaseContract] Create 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. + # + def create_with_http_info(resource_group_name, service_name, api_id, release_id, parameters, custom_headers = nil) + create_async(resource_group_name, service_name, api_id, release_id, parameters, custom_headers).value! + end + + # + # Creates a new Release for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param parameters [ApiReleaseContract] Create 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. + # + def create_async(resource_group_name, service_name, api_id, release_id, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'release_id is nil' if release_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiReleaseContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'apiId' => api_id,'releaseId' => release_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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiReleaseContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiReleaseContract.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 + + # + # Updates the details of the release of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param parameters [ApiReleaseContract] API Release Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, api_id, release_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, api_id, release_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the release of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param parameters [ApiReleaseContract] API Release Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, api_id, release_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, api_id, release_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the release of the API specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param parameters [ApiReleaseContract] API Release Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, api_id, release_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'release_id is nil' if release_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiReleaseContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'apiId' => api_id,'releaseId' => release_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 == 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 + end + + promise.execute + end + + # + # Deletes the specified release in the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, release_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, release_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified release in the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, release_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, release_id, if_match, custom_headers).value! + end + + # + # Deletes the specified release in the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param release_id [String] Release identifier within an API. Must be unique + # in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, release_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'release_id is nil' if release_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'apiId' => api_id,'releaseId' => release_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 + end + + promise.execute + end + + # + # Lists all releases of an API. An API release is created when making an API + # Revision current. Releases are also used to rollback to previous revisions. + # Results will be paged and can be constrained by the $top and $skip + # parameters. + # + # @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 [ApiReleaseCollection] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all releases of an API. An API release is created when making an API + # Revision current. Releases are also used to rollback to previous revisions. + # Results will be paged and can be constrained by the $top and $skip + # parameters. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all releases of an API. An API release is created when making an API + # Revision current. Releases are also used to rollback to previous revisions. + # Results will be paged and can be constrained by the $top and $skip + # parameters. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiReleaseCollection.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 + + # + # Lists all releases of an API. An API release is created when making an API + # Revision current. Releases are also used to rollback to previous revisions. + # Results will be paged and can be constrained by the $top and $skip + # parameters. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # |notes|ge le eq ne gt lt|substringof contains startswith endswith| + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiReleaseCollection] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_async(resource_group_name, service_name, api_id, filter, top, skip, 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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_revisions.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_revisions.rb new file mode 100644 index 0000000000..9c8ca64c9c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_revisions.rb @@ -0,0 +1,270 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiRevisions + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiRevisions class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all revisions of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # + # |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith| + # + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all revisions of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # + # |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith| + # + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all revisions of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # + # |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith| + # + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/revisions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'apiId' => api_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiRevisionCollection.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 + + # + # Lists all revisions of an API. + # + # @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 [ApiRevisionCollection] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all revisions of an API. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all revisions of an API. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiRevisionCollection.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 + + # + # Lists all revisions of an API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # + # |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith| + # + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiRevisionCollection] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_async(resource_group_name, service_name, api_id, filter, top, skip, 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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_schema.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_schema.rb new file mode 100644 index 0000000000..6001b3737b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_schema.rb @@ -0,0 +1,692 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiSchema + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiSchema class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Get the schema configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_api(resource_group_name, service_name, api_id, custom_headers = nil) + first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, custom_headers) + first_page.get_all_items + end + + # + # Get the schema configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def list_by_api_with_http_info(resource_group_name, service_name, api_id, custom_headers = nil) + list_by_api_async(resource_group_name, service_name, api_id, custom_headers).value! + end + + # + # Get the schema configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def list_by_api_async(resource_group_name, service_name, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/schemas' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SchemaCollection.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 + + # + # Gets the entity state (Etag) version of the schema specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, api_id, schema_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, api_id, schema_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the schema specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, api_id, schema_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, api_id, schema_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the schema specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, api_id, schema_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'schema_id is nil' if schema_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'schemaId' => schema_id,'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(:head, 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 + end + + promise.execute + end + + # + # Get the schema configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SchemaContract] operation results. + # + def get(resource_group_name, service_name, api_id, schema_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, schema_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the schema configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, schema_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, schema_id, custom_headers).value! + end + + # + # Get the schema configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, api_id, schema_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'schema_id is nil' if schema_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'schemaId' => schema_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SchemaContract.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 + + # + # Creates or updates schema configuration for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @param parameters [SchemaContract] The schema contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SchemaContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, schema_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, schema_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates schema configuration for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @param parameters [SchemaContract] The schema contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, schema_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, schema_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or updates schema configuration for the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @param parameters [SchemaContract] The schema contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, schema_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'schema_id is nil' if schema_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SchemaContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'schemaId' => schema_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SchemaContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SchemaContract.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 + + # + # Deletes the schema configuration at the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, schema_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, schema_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the schema configuration at the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, schema_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, schema_id, if_match, custom_headers).value! + end + + # + # Deletes the schema configuration at the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param schema_id [String] Schema identifier within an API. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, schema_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'schema_id is nil' if schema_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'schemaId' => schema_id,'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 + end + + promise.execute + end + + # + # Get the schema configuration at the API level. + # + # @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 [SchemaCollection] operation results. + # + def list_by_api_next(next_page_link, custom_headers = nil) + response = list_by_api_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the schema configuration at the API level. + # + # @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. + # + def list_by_api_next_with_http_info(next_page_link, custom_headers = nil) + list_by_api_next_async(next_page_link, custom_headers).value! + end + + # + # Get the schema configuration at the API level. + # + # @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. + # + def list_by_api_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SchemaCollection.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 the schema configuration at the API level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SchemaCollection] which provide lazy access to pages of the + # response. + # + def list_by_api_as_lazy(resource_group_name, service_name, api_id, custom_headers = nil) + response = list_by_api_async(resource_group_name, service_name, api_id, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_api_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_version_set.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_version_set.rb new file mode 100644 index 0000000000..1bc514a2c9 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_version_set.rb @@ -0,0 +1,826 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ApiVersionSet + include MsRestAzure + + # + # Creates and initializes a new instance of the ApiVersionSet class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of API Version Sets in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of API Version Sets in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of API Version Sets in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/api-version-sets' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiVersionSetCollection.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 + + # + # Gets the entity state (Etag) version of the Api Version Set specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, version_set_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, version_set_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the Api Version Set specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, version_set_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, version_set_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the Api Version Set specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, version_set_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'version_set_id is nil' if version_set_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'versionSetId' => version_set_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the Api Version Set specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiVersionSetContract] operation results. + # + def get(resource_group_name, service_name, version_set_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, version_set_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the Api Version Set specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, version_set_id, custom_headers = nil) + get_async(resource_group_name, service_name, version_set_id, custom_headers).value! + end + + # + # Gets the details of the Api Version Set specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, version_set_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'version_set_id is nil' if version_set_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'versionSetId' => version_set_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiVersionSetContract.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 + + # + # Creates or Updates a Api Version Set. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param parameters [ApiVersionSetContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiVersionSetContract] operation results. + # + def create_or_update(resource_group_name, service_name, version_set_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, version_set_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or Updates a Api Version Set. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param parameters [ApiVersionSetContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, version_set_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, version_set_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or Updates a Api Version Set. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param parameters [ApiVersionSetContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, version_set_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'version_set_id is nil' if version_set_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiVersionSetContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'versionSetId' => version_set_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiVersionSetContract.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::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiVersionSetContract.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 + + # + # Updates the details of the Api VersionSet specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param parameters [ApiVersionSetUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, version_set_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, version_set_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the Api VersionSet specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param parameters [ApiVersionSetUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, version_set_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, version_set_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the Api VersionSet specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param parameters [ApiVersionSetUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, version_set_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'version_set_id is nil' if version_set_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiVersionSetUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'versionSetId' => version_set_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 == 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 + end + + promise.execute + end + + # + # Deletes specific Api Version Set. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, version_set_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, version_set_id, if_match, custom_headers).value! + nil + end + + # + # Deletes specific Api Version Set. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, version_set_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, version_set_id, if_match, custom_headers).value! + end + + # + # Deletes specific Api Version Set. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param version_set_id [String] Api Version Set identifier. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, version_set_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'version_set_id is nil' if version_set_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'versionSetId' => version_set_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 + end + + promise.execute + end + + # + # Lists a collection of API Version Sets in the specified service instance. + # + # @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 [ApiVersionSetCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of API Version Sets in the specified service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of API Version Sets in the specified service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiVersionSetCollection.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 + + # + # Lists a collection of API Version Sets in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiVersionSetCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/authorization_server.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/authorization_server.rb new file mode 100644 index 0000000000..26e7654e88 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/authorization_server.rb @@ -0,0 +1,781 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class AuthorizationServer + include MsRestAzure + + # + # Creates and initializes a new instance of the AuthorizationServer class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of authorization servers defined within a service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of authorization servers defined within a service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of authorization servers defined within a service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/authorizationServers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AuthorizationServerCollection.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 + + # + # Gets the entity state (Etag) version of the authorizationServer specified by + # its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, authsid, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, authsid, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the authorizationServer specified by + # its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, authsid, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, authsid, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the authorizationServer specified by + # its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, authsid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'authsid is nil' if authsid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/authorizationServers/{authsid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'authsid' => authsid,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the authorization server specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AuthorizationServerContract] operation results. + # + def get(resource_group_name, service_name, authsid, custom_headers = nil) + response = get_async(resource_group_name, service_name, authsid, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the authorization server specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @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. + # + def get_with_http_info(resource_group_name, service_name, authsid, custom_headers = nil) + get_async(resource_group_name, service_name, authsid, custom_headers).value! + end + + # + # Gets the details of the authorization server specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @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. + # + def get_async(resource_group_name, service_name, authsid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'authsid is nil' if authsid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/authorizationServers/{authsid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'authsid' => authsid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AuthorizationServerContract.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 + + # + # Creates new authorization server or updates an existing authorization server. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param parameters [AuthorizationServerContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AuthorizationServerContract] operation results. + # + def create_or_update(resource_group_name, service_name, authsid, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates new authorization server or updates an existing authorization server. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param parameters [AuthorizationServerContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, authsid, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers).value! + end + + # + # Creates new authorization server or updates an existing authorization server. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param parameters [AuthorizationServerContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, authsid, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'authsid is nil' if authsid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AuthorizationServerContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'authsid' => authsid,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AuthorizationServerContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AuthorizationServerContract.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 + + # + # Updates the details of the authorization server specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param parameters [AuthorizationServerUpdateContract] OAuth2 Server settings + # Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the authorization server specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param parameters [AuthorizationServerUpdateContract] OAuth2 Server settings + # Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the authorization server specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param parameters [AuthorizationServerUpdateContract] OAuth2 Server settings + # Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, authsid, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'authsid is nil' if authsid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AuthorizationServerUpdateContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'authsid' => authsid,'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 == 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 + end + + promise.execute + end + + # + # Deletes specific authorization server instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, authsid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, authsid, if_match, custom_headers).value! + nil + end + + # + # Deletes specific authorization server instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, authsid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, authsid, if_match, custom_headers).value! + end + + # + # Deletes specific authorization server instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param authsid [String] Identifier of the authorization server. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, authsid, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'authsid is nil' if authsid.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'authsid' => authsid,'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 + end + + promise.execute + end + + # + # Lists a collection of authorization servers defined within a service + # instance. + # + # @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 [AuthorizationServerCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of authorization servers defined within a service + # instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of authorization servers defined within a service + # instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AuthorizationServerCollection.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 + + # + # Lists a collection of authorization servers defined within a service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AuthorizationServerCollection] which provide lazy access to pages of + # the response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/backend.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/backend.rb new file mode 100644 index 0000000000..5356ae50bf --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/backend.rb @@ -0,0 +1,888 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Backend + include MsRestAzure + + # + # Creates and initializes a new instance of the Backend class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of backends in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of backends in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of backends in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/backends' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::BackendCollection.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 + + # + # Gets the entity state (Etag) version of the backend specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, backendid, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, backendid, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the backend specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, backendid, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, backendid, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the backend specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, backendid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'backendid is nil' if backendid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/backends/{backendid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'backendid' => backendid,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the backend specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [BackendContract] operation results. + # + def get(resource_group_name, service_name, backendid, custom_headers = nil) + response = get_async(resource_group_name, service_name, backendid, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the backend specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, backendid, custom_headers = nil) + get_async(resource_group_name, service_name, backendid, custom_headers).value! + end + + # + # Gets the details of the backend specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, backendid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'backendid is nil' if backendid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/backends/{backendid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'backendid' => backendid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::BackendContract.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 + + # + # Creates or Updates a backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [BackendContract] operation results. + # + def create_or_update(resource_group_name, service_name, backendid, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or Updates a backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, backendid, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers).value! + end + + # + # Creates or Updates a backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, backendid, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'backendid is nil' if backendid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::BackendContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'backendid' => backendid,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::BackendContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::BackendContract.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 + + # + # Updates an existing backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates an existing backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers).value! + end + + # + # Updates an existing backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, backendid, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'backendid is nil' if backendid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::BackendUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'backendid' => backendid,'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 == 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 + end + + promise.execute + end + + # + # Deletes the specified backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, backendid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, backendid, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, backendid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, backendid, if_match, custom_headers).value! + end + + # + # Deletes the specified backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, backendid, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'backendid is nil' if backendid.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'backendid' => backendid,'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 + end + + promise.execute + end + + # + # Notifies the APIM proxy to create a new connection to the backend after the + # specified timeout. If no timeout was specified, timeout of 2 minutes is used. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendReconnectContract] Reconnect request parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def reconnect(resource_group_name, service_name, backendid, parameters = nil, custom_headers = nil) + response = reconnect_async(resource_group_name, service_name, backendid, parameters, custom_headers).value! + nil + end + + # + # Notifies the APIM proxy to create a new connection to the backend after the + # specified timeout. If no timeout was specified, timeout of 2 minutes is used. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendReconnectContract] Reconnect request 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. + # + def reconnect_with_http_info(resource_group_name, service_name, backendid, parameters = nil, custom_headers = nil) + reconnect_async(resource_group_name, service_name, backendid, parameters, custom_headers).value! + end + + # + # Notifies the APIM proxy to create a new connection to the backend after the + # specified timeout. If no timeout was specified, timeout of 2 minutes is used. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param backendid [String] Identifier of the Backend entity. Must be unique in + # the current API Management service instance. + # @param parameters [BackendReconnectContract] Reconnect request 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. + # + def reconnect_async(resource_group_name, service_name, backendid, parameters = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'backendid is nil' if backendid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::BackendReconnectContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}/reconnect' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'backendid' => backendid,'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 == 202 + 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 + end + + promise.execute + end + + # + # Lists a collection of backends in the specified service instance. + # + # @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 [BackendCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of backends in the specified service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of backends in the specified service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::BackendCollection.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 + + # + # Lists a collection of backends in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [BackendCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/certificate.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/certificate.rb new file mode 100644 index 0000000000..531d830697 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/certificate.rb @@ -0,0 +1,697 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Certificate + include MsRestAzure + + # + # Creates and initializes a new instance of the Certificate class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of all certificates in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |----------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | subject | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | expirationDate | ge, le, eq, ne, gt, lt | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of all certificates in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |----------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | subject | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | expirationDate | ge, le, eq, ne, gt, lt | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of all certificates in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |----------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | subject | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | expirationDate | ge, le, eq, ne, gt, lt | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/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,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::CertificateCollection.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 + + # + # Gets the entity state (Etag) version of the certificate specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, certificate_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, certificate_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the certificate specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, certificate_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, certificate_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the certificate specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, certificate_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/certificates/{certificateId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'certificateId' => certificate_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the certificate specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CertificateContract] operation results. + # + def get(resource_group_name, service_name, certificate_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, certificate_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the certificate specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, certificate_id, custom_headers = nil) + get_async(resource_group_name, service_name, certificate_id, custom_headers).value! + end + + # + # Gets the details of the certificate specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, certificate_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/certificates/{certificateId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'certificateId' => certificate_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::CertificateContract.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 + + # + # Creates or updates the certificate being used for authentication with the + # backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @param parameters [CertificateCreateOrUpdateParameters] Create or Update + # parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CertificateContract] operation results. + # + def create_or_update(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates the certificate being used for authentication with the + # backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @param parameters [CertificateCreateOrUpdateParameters] Create or Update + # parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or updates the certificate being used for authentication with the + # backend. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @param parameters [CertificateCreateOrUpdateParameters] Create or Update + # parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, certificate_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::CertificateCreateOrUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'certificateId' => certificate_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::CertificateContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::CertificateContract.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 + + # + # Deletes specific certificate. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers).value! + nil + end + + # + # Deletes specific certificate. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers).value! + end + + # + # Deletes specific certificate. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param certificate_id [String] Identifier of the certificate entity. Must be + # unique in the current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, certificate_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'certificate_id is nil' if certificate_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'certificateId' => certificate_id,'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 + end + + promise.execute + end + + # + # Lists a collection of all certificates in the specified service instance. + # + # @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 [CertificateCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of all certificates in the specified service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of all certificates in the specified service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::CertificateCollection.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 + + # + # Lists a collection of all certificates in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |----------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | subject | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | expirationDate | ge, le, eq, ne, gt, lt | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CertificateCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/delegation_settings.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/delegation_settings.rb new file mode 100644 index 0000000000..f52ecaa252 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/delegation_settings.rb @@ -0,0 +1,404 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class DelegationSettings + include MsRestAzure + + # + # Creates and initializes a new instance of the DelegationSettings class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the entity state (Etag) version of the DelegationSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the DelegationSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the DelegationSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/portalsettings/delegation' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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(:head, 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 + end + + promise.execute + end + + # + # Get Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PortalDelegationSettings] operation results. + # + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Get Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/portalsettings/delegation' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalDelegationSettings.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 Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalDelegationSettings] Update Delegation settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! + nil + end + + # + # Update Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalDelegationSettings] Update Delegation settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! + end + + # + # Update Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalDelegationSettings] Update Delegation settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalDelegationSettings.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 == 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 + end + + promise.execute + end + + # + # Create or Update Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalDelegationSettings] Create or update parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PortalDelegationSettings] operation results. + # + def create_or_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Create or Update Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalDelegationSettings] Create or update 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. + # + def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Create or Update Delegation settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalDelegationSettings] Create or update 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. + # + def create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalDelegationSettings.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalDelegationSettings.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 + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/diagnostic.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/diagnostic.rb new file mode 100644 index 0000000000..a3a15f16c7 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/diagnostic.rb @@ -0,0 +1,774 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Diagnostic + include MsRestAzure + + # + # Creates and initializes a new instance of the Diagnostic class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all diagnostics of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all diagnostics of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists all diagnostics of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/diagnostics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticCollection.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 + + # + # Gets the entity state (Etag) version of the Diagnostic specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, diagnostic_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, diagnostic_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the Diagnostic specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, diagnostic_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, diagnostic_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the Diagnostic specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, diagnostic_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'diagnosticId' => diagnostic_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the Diagnostic specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiagnosticContract] operation results. + # + def get(resource_group_name, service_name, diagnostic_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, diagnostic_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the Diagnostic specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, diagnostic_id, custom_headers = nil) + get_async(resource_group_name, service_name, diagnostic_id, custom_headers).value! + end + + # + # Gets the details of the Diagnostic specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, diagnostic_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'diagnosticId' => diagnostic_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.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 + + # + # Creates a new Diagnostic or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiagnosticContract] operation results. + # + def create_or_update(resource_group_name, service_name, diagnostic_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, diagnostic_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a new Diagnostic or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, diagnostic_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, diagnostic_id, parameters, if_match, custom_headers).value! + end + + # + # Creates a new Diagnostic or updates an existing one. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, diagnostic_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'diagnosticId' => diagnostic_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.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 + + # + # Updates the details of the Diagnostic specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Diagnostic Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, diagnostic_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, diagnostic_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the Diagnostic specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Diagnostic Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, diagnostic_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, diagnostic_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the Diagnostic specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param parameters [DiagnosticContract] Diagnostic Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, diagnostic_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'diagnosticId' => diagnostic_id,'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 == 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 + end + + promise.execute + end + + # + # Deletes the specified Diagnostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, diagnostic_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, diagnostic_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified Diagnostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, diagnostic_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, diagnostic_id, if_match, custom_headers).value! + end + + # + # Deletes the specified Diagnostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, diagnostic_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'diagnosticId' => diagnostic_id,'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 + end + + promise.execute + end + + # + # Lists all diagnostics of the API Management service instance. + # + # @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 [DiagnosticCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all diagnostics of the API Management service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all diagnostics of the API Management service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DiagnosticCollection.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 + + # + # Lists all diagnostics of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiagnosticCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/diagnostic_logger.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/diagnostic_logger.rb new file mode 100644 index 0000000000..1c24a1cec8 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/diagnostic_logger.rb @@ -0,0 +1,577 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class DiagnosticLogger + include MsRestAzure + + # + # Creates and initializes a new instance of the DiagnosticLogger class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all loggers assosiated with the specified Diagnostic of the API + # Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | type | eq | | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, diagnostic_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, diagnostic_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all loggers assosiated with the specified Diagnostic of the API + # Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | type | eq | | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, diagnostic_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, diagnostic_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all loggers assosiated with the specified Diagnostic of the API + # Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | type | eq | | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, diagnostic_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'diagnosticId' => diagnostic_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skip' => skip}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerCollection.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 + + # + # Checks that logger entity specified by identifier is associated with the + # diagnostics entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_entity_exists(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + response = check_entity_exists_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers).value! + response.body unless response.nil? + end + + # + # Checks that logger entity specified by identifier is associated with the + # diagnostics entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def check_entity_exists_with_http_info(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + check_entity_exists_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers).value! + end + + # + # Checks that logger entity specified by identifier is associated with the + # diagnostics entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def check_entity_exists_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'diagnosticId' => diagnostic_id,'loggerid' => loggerid,'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(:head, 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 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 204) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Attaches a logger to a dignostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LoggerContract] operation results. + # + def create_or_update(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers).value! + response.body unless response.nil? + end + + # + # Attaches a logger to a dignostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers).value! + end + + # + # Attaches a logger to a dignostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def create_or_update_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'diagnosticId' => diagnostic_id,'loggerid' => loggerid,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerContract.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 + + # + # Deletes the specified Logger from Diagnostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + response = delete_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers).value! + nil + end + + # + # Deletes the specified Logger from Diagnostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + delete_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers).value! + end + + # + # Deletes the specified Logger from Diagnostic. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def delete_async(resource_group_name, service_name, diagnostic_id, loggerid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'diagnostic_id is nil' if diagnostic_id.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'diagnosticId' => diagnostic_id,'loggerid' => loggerid,'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 + end + + promise.execute + end + + # + # Lists all loggers assosiated with the specified Diagnostic of the API + # Management service instance. + # + # @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 [LoggerCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all loggers assosiated with the specified Diagnostic of the API + # Management service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all loggers assosiated with the specified Diagnostic of the API + # Management service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerCollection.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 + + # + # Lists all loggers assosiated with the specified Diagnostic of the API + # Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param diagnostic_id [String] Diagnostic identifier. Must be unique in the + # current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | + # | type | eq | | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LoggerCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, diagnostic_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, diagnostic_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/email_template.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/email_template.rb new file mode 100644 index 0000000000..16deb6aec6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/email_template.rb @@ -0,0 +1,873 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class EmailTemplate + include MsRestAzure + + # + # Creates and initializes a new instance of the EmailTemplate class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, top, skip, custom_headers).value! + end + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/templates' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::EmailTemplateCollection.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 + + # + # Gets the entity state (Etag) version of the email template specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, template_name, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, template_name, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the email template specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, template_name, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, template_name, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the email template specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, template_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'template_name is nil' if template_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/templates/{templateName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'templateName' => template_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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the email template specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EmailTemplateContract] operation results. + # + def get(resource_group_name, service_name, template_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, template_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the email template specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @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. + # + def get_with_http_info(resource_group_name, service_name, template_name, custom_headers = nil) + get_async(resource_group_name, service_name, template_name, custom_headers).value! + end + + # + # Gets the details of the email template specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @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. + # + def get_async(resource_group_name, service_name, template_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'template_name is nil' if template_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/templates/{templateName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'templateName' => template_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::EmailTemplateContract.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 + + # + # Updates an Email Template. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param parameters [EmailTemplateUpdateParameters] Email Template update + # parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EmailTemplateContract] operation results. + # + def create_or_update(resource_group_name, service_name, template_name, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, template_name, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates an Email Template. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param parameters [EmailTemplateUpdateParameters] Email Template update + # parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, template_name, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, template_name, parameters, if_match, custom_headers).value! + end + + # + # Updates an Email Template. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param parameters [EmailTemplateUpdateParameters] Email Template update + # parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, template_name, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'template_name is nil' if template_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::EmailTemplateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'templateName' => template_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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::EmailTemplateContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::EmailTemplateContract.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 + + # + # Updates the specific Email Template. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param parameters [EmailTemplateUpdateParameters] Update parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, template_name, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, template_name, parameters, custom_headers).value! + nil + end + + # + # Updates the specific Email Template. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param parameters [EmailTemplateUpdateParameters] Update 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. + # + def update_with_http_info(resource_group_name, service_name, template_name, parameters, custom_headers = nil) + update_async(resource_group_name, service_name, template_name, parameters, custom_headers).value! + end + + # + # Updates the specific Email Template. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param parameters [EmailTemplateUpdateParameters] Update 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. + # + def update_async(resource_group_name, service_name, template_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'template_name is nil' if template_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::EmailTemplateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'templateName' => template_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 == 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 + end + + promise.execute + end + + # + # Reset the Email Template to default template provided by the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, template_name, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, template_name, if_match, custom_headers).value! + nil + end + + # + # Reset the Email Template to default template provided by the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, template_name, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, template_name, if_match, custom_headers).value! + end + + # + # Reset the Email Template to default template provided by the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param template_name [TemplateName] Email Template Name Identifier. Possible + # values include: 'applicationApprovedNotificationMessage', + # 'accountClosedDeveloper', + # 'quotaLimitApproachingDeveloperNotificationMessage', + # 'newDeveloperNotificationMessage', 'emailChangeIdentityDefault', + # 'inviteUserNotificationMessage', 'newCommentNotificationMessage', + # 'confirmSignUpIdentityDefault', 'newIssueNotificationMessage', + # 'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault', + # 'passwordResetByAdminNotificationMessage', + # 'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage' + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, template_name, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'template_name is nil' if template_name.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'templateName' => template_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 + end + + promise.execute + end + + # + # Lists a collection of properties defined within a service instance. + # + # @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 [EmailTemplateCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of properties defined within a service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of properties defined within a service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::EmailTemplateCollection.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 + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EmailTemplateCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/group.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/group.rb new file mode 100644 index 0000000000..4806ece962 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/group.rb @@ -0,0 +1,801 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Group + include MsRestAzure + + # + # Creates and initializes a new instance of the Group class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of groups defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq, ne | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of groups defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq, ne | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of groups defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq, ne | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/groups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupCollection.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 + + # + # Gets the entity state (Etag) version of the group specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, group_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, group_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the group specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, group_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, group_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the group specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, group_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/groups/{groupId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the group specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GroupContract] operation results. + # + def get(resource_group_name, service_name, group_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, group_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the group specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, group_id, custom_headers = nil) + get_async(resource_group_name, service_name, group_id, custom_headers).value! + end + + # + # Gets the details of the group specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, group_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/groups/{groupId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupContract.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 + + # + # Creates or Updates a group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param parameters [GroupCreateParameters] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GroupContract] operation results. + # + def create_or_update(resource_group_name, service_name, group_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or Updates a group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param parameters [GroupCreateParameters] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, group_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or Updates a group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param parameters [GroupCreateParameters] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, group_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupCreateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupContract.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 + + # + # Updates the details of the group specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param parameters [GroupUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the group specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param parameters [GroupUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the group specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param parameters [GroupUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, group_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'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 == 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 + end + + promise.execute + end + + # + # Deletes specific group of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, group_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, group_id, if_match, custom_headers).value! + nil + end + + # + # Deletes specific group of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, group_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, group_id, if_match, custom_headers).value! + end + + # + # Deletes specific group of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, group_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'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 + end + + promise.execute + end + + # + # Lists a collection of groups defined within a service instance. + # + # @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 [GroupCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of groups defined within a service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of groups defined within a service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupCollection.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 + + # + # Lists a collection of groups defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq, ne | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GroupCollection] which provide lazy access to pages of the response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/group_user.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/group_user.rb new file mode 100644 index 0000000000..a5f8870e4a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/group_user.rb @@ -0,0 +1,617 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class GroupUser + include MsRestAzure + + # + # Creates and initializes a new instance of the GroupUser class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of the members of the group, specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, group_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of the members of the group, specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_with_http_info(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_async(resource_group_name, service_name, group_id, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of the members of the group, specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_async(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/groups/{groupId}/users' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserCollection.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 + + # + # Checks that user entity specified by identifier is associated with the group + # entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_entity_exists(resource_group_name, service_name, group_id, uid, custom_headers = nil) + response = check_entity_exists_async(resource_group_name, service_name, group_id, uid, custom_headers).value! + response.body unless response.nil? + end + + # + # Checks that user entity specified by identifier is associated with the group + # entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def check_entity_exists_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers = nil) + check_entity_exists_async(resource_group_name, service_name, group_id, uid, custom_headers).value! + end + + # + # Checks that user entity specified by identifier is associated with the group + # entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def check_entity_exists_async(resource_group_name, service_name, group_id, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'uid' => uid,'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(:head, 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 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 204) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Adds a user to the specified group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UserContract] operation results. + # + def create(resource_group_name, service_name, group_id, uid, custom_headers = nil) + response = create_async(resource_group_name, service_name, group_id, uid, custom_headers).value! + response.body unless response.nil? + end + + # + # Adds a user to the specified group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def create_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers = nil) + create_async(resource_group_name, service_name, group_id, uid, custom_headers).value! + end + + # + # Adds a user to the specified group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def create_async(resource_group_name, service_name, group_id, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'uid' => uid,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserContract.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 + + # + # Remove existing user from existing group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, group_id, uid, custom_headers = nil) + response = delete_async(resource_group_name, service_name, group_id, uid, custom_headers).value! + nil + end + + # + # Remove existing user from existing group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers = nil) + delete_async(resource_group_name, service_name, group_id, uid, custom_headers).value! + end + + # + # Remove existing user from existing group. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def delete_async(resource_group_name, service_name, group_id, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'groupId' => group_id,'uid' => uid,'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 + end + + promise.execute + end + + # + # Lists a collection of the members of the group, specified by its identifier. + # + # @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 [UserCollection] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of the members of the group, specified by its identifier. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of the members of the group, specified by its identifier. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserCollection.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 + + # + # Lists a collection of the members of the group, specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UserCollection] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, service_name, group_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_async(resource_group_name, service_name, group_id, filter, top, skip, 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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/identity_provider.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/identity_provider.rb new file mode 100644 index 0000000000..506f1540d9 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/identity_provider.rb @@ -0,0 +1,775 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class IdentityProvider + include MsRestAzure + + # + # Creates and initializes a new instance of the IdentityProvider class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of Identity Provider configured in the specified service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of Identity Provider configured in the specified service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Lists a collection of Identity Provider configured in the specified service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def list_by_service_async(resource_group_name, service_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, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/identityProviders' + + 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,'serviceName' => service_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IdentityProviderList.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 + + # + # Gets the entity state (Etag) version of the identityProvider specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, identity_provider_name, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, identity_provider_name, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the identityProvider specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, identity_provider_name, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, identity_provider_name, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the identityProvider specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, identity_provider_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, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}' + + 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,'serviceName' => service_name,'identityProviderName' => identity_provider_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:head, 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 + end + + promise.execute + end + + # + # Gets the configuration details of the identity Provider configured in + # specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IdentityProviderContract] operation results. + # + def get(resource_group_name, service_name, identity_provider_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, identity_provider_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the configuration details of the identity Provider configured in + # specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @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. + # + def get_with_http_info(resource_group_name, service_name, identity_provider_name, custom_headers = nil) + get_async(resource_group_name, service_name, identity_provider_name, custom_headers).value! + end + + # + # Gets the configuration details of the identity Provider configured in + # specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @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. + # + def get_async(resource_group_name, service_name, identity_provider_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, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}' + + 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,'serviceName' => service_name,'identityProviderName' => identity_provider_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IdentityProviderContract.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 + + # + # Creates or Updates the IdentityProvider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param parameters [IdentityProviderContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IdentityProviderContract] operation results. + # + def create_or_update(resource_group_name, service_name, identity_provider_name, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or Updates the IdentityProvider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param parameters [IdentityProviderContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers).value! + end + + # + # Creates or Updates the IdentityProvider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param parameters [IdentityProviderContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IdentityProviderContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'identityProviderName' => identity_provider_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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IdentityProviderContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IdentityProviderContract.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 + + # + # Updates an existing IdentityProvider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param parameters [IdentityProviderUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates an existing IdentityProvider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param parameters [IdentityProviderUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers).value! + end + + # + # Updates an existing IdentityProvider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param parameters [IdentityProviderUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, identity_provider_name, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IdentityProviderUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'identityProviderName' => identity_provider_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 == 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 + end + + promise.execute + end + + # + # Deletes the specified identity provider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified identity provider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers).value! + end + + # + # Deletes the specified identity provider configuration. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param identity_provider_name [IdentityProviderType] Identity Provider Type + # identifier. Possible values include: 'facebook', 'google', 'microsoft', + # 'twitter', 'aad', 'aadB2C' + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, identity_provider_name, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'identity_provider_name is nil' if identity_provider_name.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'identityProviderName' => identity_provider_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 + end + + promise.execute + end + + # + # Lists a collection of Identity Provider configured in the specified service + # instance. + # + # @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 [IdentityProviderList] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of Identity Provider configured in the specified service + # instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of Identity Provider configured in the specified service + # instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::IdentityProviderList.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 + + # + # Lists a collection of Identity Provider configured in the specified service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [IdentityProviderList] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/logger.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/logger.rb new file mode 100644 index 0000000000..a7df35bec4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/logger.rb @@ -0,0 +1,786 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Logger + include MsRestAzure + + # + # Creates and initializes a new instance of the Logger class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of loggers in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of loggers in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of loggers in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/loggers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerCollection.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 + + # + # Gets the entity state (Etag) version of the logger specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, loggerid, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, loggerid, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the logger specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, loggerid, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, loggerid, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the logger specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, loggerid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'loggerid' => loggerid,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the logger specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LoggerContract] operation results. + # + def get(resource_group_name, service_name, loggerid, custom_headers = nil) + response = get_async(resource_group_name, service_name, loggerid, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the logger specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, loggerid, custom_headers = nil) + get_async(resource_group_name, service_name, loggerid, custom_headers).value! + end + + # + # Gets the details of the logger specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, loggerid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'loggerid' => loggerid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerContract.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 + + # + # Creates or Updates a logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param parameters [LoggerContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LoggerContract] operation results. + # + def create_or_update(resource_group_name, service_name, loggerid, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or Updates a logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param parameters [LoggerContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, loggerid, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers).value! + end + + # + # Creates or Updates a logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param parameters [LoggerContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, loggerid, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'loggerid' => loggerid,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerContract.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 + + # + # Updates an existing logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param parameters [LoggerUpdateContract] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates an existing logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param parameters [LoggerUpdateContract] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers).value! + end + + # + # Updates an existing logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param parameters [LoggerUpdateContract] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, loggerid, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerUpdateContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'loggerid' => loggerid,'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 == 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 + end + + promise.execute + end + + # + # Deletes the specified logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers).value! + end + + # + # Deletes the specified logger. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param loggerid [String] Logger identifier. Must be unique in the API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, loggerid, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'loggerid is nil' if loggerid.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'loggerid' => loggerid,'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 + end + + promise.execute + end + + # + # Lists a collection of loggers in the specified service instance. + # + # @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 [LoggerCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of loggers in the specified service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of loggers in the specified service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::LoggerCollection.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 + + # + # Lists a collection of loggers in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LoggerCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/access_information_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/access_information_contract.rb new file mode 100644 index 0000000000..81b7b5a5a6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/access_information_contract.rb @@ -0,0 +1,75 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Tenant access information contract of the API Management service. + # + class AccessInformationContract + + include MsRestAzure + + # @return [String] Identifier. + attr_accessor :id + + # @return [String] Primary access key. + attr_accessor :primary_key + + # @return [String] Secondary access key. + attr_accessor :secondary_key + + # @return [Boolean] Tenant access information of the API Management + # service. + attr_accessor :enabled + + + # + # Mapper for AccessInformationContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AccessInformationContract', + type: { + name: 'Composite', + class_name: 'AccessInformationContract', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + primary_key: { + required: false, + serialized_name: 'primaryKey', + type: { + name: 'String' + } + }, + secondary_key: { + required: false, + serialized_name: 'secondaryKey', + type: { + name: 'String' + } + }, + enabled: { + required: false, + serialized_name: 'enabled', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb new file mode 100644 index 0000000000..67a27fd9f6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/access_information_update_parameters.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Tenant access information update parameters of the API Management + # service. + # + class AccessInformationUpdateParameters + + include MsRestAzure + + # @return [Boolean] Tenant access information of the API Management + # service. + attr_accessor :enabled + + + # + # Mapper for AccessInformationUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AccessInformationUpdateParameters', + type: { + name: 'Composite', + class_name: 'AccessInformationUpdateParameters', + model_properties: { + enabled: { + required: false, + serialized_name: 'enabled', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/additional_location.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/additional_location.rb new file mode 100644 index 0000000000..32877a0f84 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/additional_location.rb @@ -0,0 +1,122 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Description of an additional API Management resource location. + # + class AdditionalLocation + + include MsRestAzure + + # @return [String] The location name of the additional region among Azure + # Data center regions. + attr_accessor :location + + # @return [ApiManagementServiceSkuProperties] SKU properties of the API + # Management service. + attr_accessor :sku + + # @return [Array] Public Static Load Balanced IP addresses of the + # API Management service in the additional location. Available only for + # Basic, Standard and Premium SKU. + attr_accessor :public_ipaddresses + + # @return [Array] Private Static Load Balanced IP addresses of + # the API Management service which is deployed in an Internal Virtual + # Network in a particular additional location. Available only for Basic, + # Standard and Premium SKU. + attr_accessor :private_ipaddresses + + # @return [VirtualNetworkConfiguration] Virtual network configuration for + # the location. + attr_accessor :virtual_network_configuration + + # @return [String] Gateway URL of the API Management service in the + # Region. + attr_accessor :gateway_regional_url + + + # + # Mapper for AdditionalLocation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AdditionalLocation', + type: { + name: 'Composite', + class_name: 'AdditionalLocation', + model_properties: { + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + sku: { + required: true, + serialized_name: 'sku', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceSkuProperties' + } + }, + public_ipaddresses: { + required: false, + read_only: true, + serialized_name: 'publicIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_ipaddresses: { + required: false, + read_only: true, + serialized_name: 'privateIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + virtual_network_configuration: { + required: false, + serialized_name: 'virtualNetworkConfiguration', + type: { + name: 'Composite', + class_name: 'VirtualNetworkConfiguration' + } + }, + gateway_regional_url: { + required: false, + read_only: true, + serialized_name: 'gatewayRegionalUrl', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_collection.rb new file mode 100644 index 0000000000..39dab8210e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_collection.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Api list representation. + # + class ApiCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ApiCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ApiCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiCollection', + type: { + name: 'Composite', + class_name: 'ApiCollection', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ApiContractElementType', + type: { + name: 'Composite', + class_name: 'ApiContract' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_contract.rb new file mode 100644 index 0000000000..b0123a7c7e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_contract.rb @@ -0,0 +1,241 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API details. + # + class ApiContract < Resource + + include MsRestAzure + + # @return [String] Description of the API. May include HTML formatting + # tags. + attr_accessor :description + + # @return [AuthenticationSettingsContract] Collection of authentication + # settings included into this API. + attr_accessor :authentication_settings + + # @return [SubscriptionKeyParameterNamesContract] Protocols over which + # API is made available. + attr_accessor :subscription_key_parameter_names + + # @return [ApiType] Type of API. Possible values include: 'http', 'soap' + attr_accessor :api_type + + # @return [String] Describes the Revision of the Api. If no value is + # provided, default revision 1 is created + attr_accessor :api_revision + + # @return [String] Indicates the Version identifier of the API if the API + # is versioned + attr_accessor :api_version + + # @return [Boolean] Indicates if API revision is current api revision. + attr_accessor :is_current + + # @return [Boolean] Indicates if API revision is accessible via the + # gateway. + attr_accessor :is_online + + # @return [String] A resource identifier for the related ApiVersionSet. + attr_accessor :api_version_set_id + + # @return [String] API name. + attr_accessor :display_name + + # @return [String] Absolute URL of the backend service implementing this + # API. + attr_accessor :service_url + + # @return [String] Relative URL uniquely identifying this API and all of + # its resource paths within the API Management service instance. It is + # appended to the API endpoint base URL specified during the service + # instance creation to form a public URL for this API. + attr_accessor :path + + # @return [Array] Describes on which protocols the operations + # in this API can be invoked. + attr_accessor :protocols + + # @return [ApiVersionSetContractDetails] + attr_accessor :api_version_set + + + # + # Mapper for ApiContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiContract', + type: { + name: 'Composite', + class_name: 'ApiContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + authentication_settings: { + required: false, + serialized_name: 'properties.authenticationSettings', + type: { + name: 'Composite', + class_name: 'AuthenticationSettingsContract' + } + }, + subscription_key_parameter_names: { + required: false, + serialized_name: 'properties.subscriptionKeyParameterNames', + type: { + name: 'Composite', + class_name: 'SubscriptionKeyParameterNamesContract' + } + }, + api_type: { + required: false, + serialized_name: 'properties.type', + type: { + name: 'String' + } + }, + api_revision: { + required: false, + serialized_name: 'properties.apiRevision', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + api_version: { + required: false, + serialized_name: 'properties.apiVersion', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + is_current: { + required: false, + read_only: true, + serialized_name: 'properties.isCurrent', + type: { + name: 'Boolean' + } + }, + is_online: { + required: false, + read_only: true, + serialized_name: 'properties.isOnline', + type: { + name: 'Boolean' + } + }, + api_version_set_id: { + required: false, + serialized_name: 'properties.apiVersionSetId', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + service_url: { + required: false, + serialized_name: 'properties.serviceUrl', + constraints: { + MaxLength: 2000, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + path: { + required: true, + serialized_name: 'properties.path', + constraints: { + MaxLength: 400, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + protocols: { + required: false, + serialized_name: 'properties.protocols', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ProtocolElementType', + type: { + name: 'Enum', + module: 'Protocol' + } + } + } + }, + api_version_set: { + required: false, + serialized_name: 'properties.apiVersionSet', + type: { + name: 'Composite', + class_name: 'ApiVersionSetContractDetails' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_contract_properties.rb new file mode 100644 index 0000000000..ad6035f2d8 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_contract_properties.rb @@ -0,0 +1,184 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Api Entity Properties + # + class ApiContractProperties < ApiEntityBaseContract + + include MsRestAzure + + # @return [String] API name. + attr_accessor :display_name + + # @return [String] Absolute URL of the backend service implementing this + # API. + attr_accessor :service_url + + # @return [String] Relative URL uniquely identifying this API and all of + # its resource paths within the API Management service instance. It is + # appended to the API endpoint base URL specified during the service + # instance creation to form a public URL for this API. + attr_accessor :path + + # @return [Array] Describes on which protocols the operations + # in this API can be invoked. + attr_accessor :protocols + + # @return [ApiVersionSetContractDetails] + attr_accessor :api_version_set + + + # + # Mapper for ApiContractProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiContractProperties', + type: { + name: 'Composite', + class_name: 'ApiContractProperties', + model_properties: { + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + authentication_settings: { + required: false, + serialized_name: 'authenticationSettings', + type: { + name: 'Composite', + class_name: 'AuthenticationSettingsContract' + } + }, + subscription_key_parameter_names: { + required: false, + serialized_name: 'subscriptionKeyParameterNames', + type: { + name: 'Composite', + class_name: 'SubscriptionKeyParameterNamesContract' + } + }, + api_type: { + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + api_revision: { + required: false, + serialized_name: 'apiRevision', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + api_version: { + required: false, + serialized_name: 'apiVersion', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + is_current: { + required: false, + read_only: true, + serialized_name: 'isCurrent', + type: { + name: 'Boolean' + } + }, + is_online: { + required: false, + read_only: true, + serialized_name: 'isOnline', + type: { + name: 'Boolean' + } + }, + api_version_set_id: { + required: false, + serialized_name: 'apiVersionSetId', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + service_url: { + required: false, + serialized_name: 'serviceUrl', + constraints: { + MaxLength: 2000, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + path: { + required: true, + serialized_name: 'path', + constraints: { + MaxLength: 400, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + protocols: { + required: false, + serialized_name: 'protocols', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ProtocolElementType', + type: { + name: 'Enum', + module: 'Protocol' + } + } + } + }, + api_version_set: { + required: false, + serialized_name: 'apiVersionSet', + type: { + name: 'Composite', + class_name: 'ApiVersionSetContractDetails' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_create_or_update_parameter.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_create_or_update_parameter.rb new file mode 100644 index 0000000000..98b78e87d6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_create_or_update_parameter.rb @@ -0,0 +1,265 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API Create or Update Parameters. + # + class ApiCreateOrUpdateParameter + + include MsRestAzure + + # @return [String] Description of the API. May include HTML formatting + # tags. + attr_accessor :description + + # @return [AuthenticationSettingsContract] Collection of authentication + # settings included into this API. + attr_accessor :authentication_settings + + # @return [SubscriptionKeyParameterNamesContract] Protocols over which + # API is made available. + attr_accessor :subscription_key_parameter_names + + # @return [ApiType] Type of API. Possible values include: 'http', 'soap' + attr_accessor :api_type + + # @return [String] Describes the Revision of the Api. If no value is + # provided, default revision 1 is created + attr_accessor :api_revision + + # @return [String] Indicates the Version identifier of the API if the API + # is versioned + attr_accessor :api_version + + # @return [Boolean] Indicates if API revision is current api revision. + attr_accessor :is_current + + # @return [Boolean] Indicates if API revision is accessible via the + # gateway. + attr_accessor :is_online + + # @return [String] A resource identifier for the related ApiVersionSet. + attr_accessor :api_version_set_id + + # @return [String] API name. + attr_accessor :display_name + + # @return [String] Absolute URL of the backend service implementing this + # API. + attr_accessor :service_url + + # @return [String] Relative URL uniquely identifying this API and all of + # its resource paths within the API Management service instance. It is + # appended to the API endpoint base URL specified during the service + # instance creation to form a public URL for this API. + attr_accessor :path + + # @return [Array] Describes on which protocols the operations + # in this API can be invoked. + attr_accessor :protocols + + # @return [ApiVersionSetContractDetails] + attr_accessor :api_version_set + + # @return [String] Content value when Importing an API. + attr_accessor :content_value + + # @return [ContentFormat] Format of the Content in which the API is + # getting imported. Possible values include: 'wadl-xml', + # 'wadl-link-json', 'swagger-json', 'swagger-link-json', 'wsdl', + # 'wsdl-link' + attr_accessor :content_format + + # @return [ApiCreateOrUpdatePropertiesWsdlSelector] Criteria to limit + # import of WSDL to a subset of the document. + attr_accessor :wsdl_selector + + # @return [SoapApiType] Type of Api to create. + # * `http` creates a SOAP to REST API + # * `soap` creates a SOAP pass-through API. Possible values include: + # 'SoapToRest', 'SoapPassThrough' + attr_accessor :soap_api_type + + + # + # Mapper for ApiCreateOrUpdateParameter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiCreateOrUpdateParameter', + type: { + name: 'Composite', + class_name: 'ApiCreateOrUpdateParameter', + model_properties: { + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + authentication_settings: { + required: false, + serialized_name: 'properties.authenticationSettings', + type: { + name: 'Composite', + class_name: 'AuthenticationSettingsContract' + } + }, + subscription_key_parameter_names: { + required: false, + serialized_name: 'properties.subscriptionKeyParameterNames', + type: { + name: 'Composite', + class_name: 'SubscriptionKeyParameterNamesContract' + } + }, + api_type: { + required: false, + serialized_name: 'properties.type', + type: { + name: 'String' + } + }, + api_revision: { + required: false, + serialized_name: 'properties.apiRevision', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + api_version: { + required: false, + serialized_name: 'properties.apiVersion', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + is_current: { + required: false, + read_only: true, + serialized_name: 'properties.isCurrent', + type: { + name: 'Boolean' + } + }, + is_online: { + required: false, + read_only: true, + serialized_name: 'properties.isOnline', + type: { + name: 'Boolean' + } + }, + api_version_set_id: { + required: false, + serialized_name: 'properties.apiVersionSetId', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + service_url: { + required: false, + serialized_name: 'properties.serviceUrl', + constraints: { + MaxLength: 2000, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + path: { + required: true, + serialized_name: 'properties.path', + constraints: { + MaxLength: 400, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + protocols: { + required: false, + serialized_name: 'properties.protocols', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ProtocolElementType', + type: { + name: 'Enum', + module: 'Protocol' + } + } + } + }, + api_version_set: { + required: false, + serialized_name: 'properties.apiVersionSet', + type: { + name: 'Composite', + class_name: 'ApiVersionSetContractDetails' + } + }, + content_value: { + required: false, + serialized_name: 'properties.contentValue', + type: { + name: 'String' + } + }, + content_format: { + required: false, + serialized_name: 'properties.contentFormat', + type: { + name: 'String' + } + }, + wsdl_selector: { + required: false, + serialized_name: 'properties.wsdlSelector', + type: { + name: 'Composite', + class_name: 'ApiCreateOrUpdatePropertiesWsdlSelector' + } + }, + soap_api_type: { + required: false, + serialized_name: 'properties.apiType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_create_or_update_properties_wsdl_selector.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_create_or_update_properties_wsdl_selector.rb new file mode 100644 index 0000000000..26321e7492 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_create_or_update_properties_wsdl_selector.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Criteria to limit import of WSDL to a subset of the document. + # + class ApiCreateOrUpdatePropertiesWsdlSelector + + include MsRestAzure + + # @return [String] Name of service to import from WSDL + attr_accessor :wsdl_service_name + + # @return [String] Name of endpoint(port) to import from WSDL + attr_accessor :wsdl_endpoint_name + + + # + # Mapper for ApiCreateOrUpdatePropertiesWsdlSelector class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiCreateOrUpdateProperties_wsdlSelector', + type: { + name: 'Composite', + class_name: 'ApiCreateOrUpdatePropertiesWsdlSelector', + model_properties: { + wsdl_service_name: { + required: false, + serialized_name: 'wsdlServiceName', + type: { + name: 'String' + } + }, + wsdl_endpoint_name: { + required: false, + serialized_name: 'wsdlEndpointName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_entity_base_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_entity_base_contract.rb new file mode 100644 index 0000000000..13974ac282 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_entity_base_contract.rb @@ -0,0 +1,141 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API base contract details. + # + class ApiEntityBaseContract + + include MsRestAzure + + # @return [String] Description of the API. May include HTML formatting + # tags. + attr_accessor :description + + # @return [AuthenticationSettingsContract] Collection of authentication + # settings included into this API. + attr_accessor :authentication_settings + + # @return [SubscriptionKeyParameterNamesContract] Protocols over which + # API is made available. + attr_accessor :subscription_key_parameter_names + + # @return [ApiType] Type of API. Possible values include: 'http', 'soap' + attr_accessor :api_type + + # @return [String] Describes the Revision of the Api. If no value is + # provided, default revision 1 is created + attr_accessor :api_revision + + # @return [String] Indicates the Version identifier of the API if the API + # is versioned + attr_accessor :api_version + + # @return [Boolean] Indicates if API revision is current api revision. + attr_accessor :is_current + + # @return [Boolean] Indicates if API revision is accessible via the + # gateway. + attr_accessor :is_online + + # @return [String] A resource identifier for the related ApiVersionSet. + attr_accessor :api_version_set_id + + + # + # Mapper for ApiEntityBaseContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiEntityBaseContract', + type: { + name: 'Composite', + class_name: 'ApiEntityBaseContract', + model_properties: { + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + authentication_settings: { + required: false, + serialized_name: 'authenticationSettings', + type: { + name: 'Composite', + class_name: 'AuthenticationSettingsContract' + } + }, + subscription_key_parameter_names: { + required: false, + serialized_name: 'subscriptionKeyParameterNames', + type: { + name: 'Composite', + class_name: 'SubscriptionKeyParameterNamesContract' + } + }, + api_type: { + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + api_revision: { + required: false, + serialized_name: 'apiRevision', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + api_version: { + required: false, + serialized_name: 'apiVersion', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + is_current: { + required: false, + read_only: true, + serialized_name: 'isCurrent', + type: { + name: 'Boolean' + } + }, + is_online: { + required: false, + read_only: true, + serialized_name: 'isOnline', + type: { + name: 'Boolean' + } + }, + api_version_set_id: { + required: false, + serialized_name: 'apiVersionSetId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_export_result.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_export_result.rb new file mode 100644 index 0000000000..a4f772fb88 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_export_result.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API Export result Blob Uri. + # + class ApiExportResult + + include MsRestAzure + + # @return [String] Link to the Storage Blob containing the result of the + # export operation. The Blob Uri is only valid for 5 minutes. + attr_accessor :link + + + # + # Mapper for ApiExportResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiExportResult', + type: { + name: 'Composite', + class_name: 'ApiExportResult', + model_properties: { + link: { + required: false, + serialized_name: 'link', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_apply_network_configuration_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_apply_network_configuration_parameters.rb new file mode 100644 index 0000000000..e8209c4bee --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_apply_network_configuration_parameters.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameter supplied to the Apply Network configuration operation. + # + class ApiManagementServiceApplyNetworkConfigurationParameters + + include MsRestAzure + + # @return [String] Location of the Api Management service to update for a + # multi-region service. For a service deployed in a single region, this + # parameter is not required. + attr_accessor :location + + + # + # Mapper for ApiManagementServiceApplyNetworkConfigurationParameters + # class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceApplyNetworkConfigurationParameters', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceApplyNetworkConfigurationParameters', + model_properties: { + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb new file mode 100644 index 0000000000..024f2fdf67 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_backup_restore_parameters.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Backup/Restore of an API Management service + # operation. + # + class ApiManagementServiceBackupRestoreParameters + + include MsRestAzure + + # @return [String] Azure Cloud Storage account (used to place/retrieve + # the backup) name. + attr_accessor :storage_account + + # @return [String] Azure Cloud Storage account (used to place/retrieve + # the backup) access key. + attr_accessor :access_key + + # @return [String] Azure Cloud Storage blob container name used to + # place/retrieve the backup. + attr_accessor :container_name + + # @return [String] The name of the backup file to create. + attr_accessor :backup_name + + + # + # Mapper for ApiManagementServiceBackupRestoreParameters class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceBackupRestoreParameters', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceBackupRestoreParameters', + model_properties: { + storage_account: { + required: true, + serialized_name: 'storageAccount', + type: { + name: 'String' + } + }, + access_key: { + required: true, + serialized_name: 'accessKey', + type: { + name: 'String' + } + }, + container_name: { + required: true, + serialized_name: 'containerName', + type: { + name: 'String' + } + }, + backup_name: { + required: true, + serialized_name: 'backupName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_base_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_base_properties.rb new file mode 100644 index 0000000000..bbe0b6279c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_base_properties.rb @@ -0,0 +1,298 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Base Properties of an API Management service resource description. + # + class ApiManagementServiceBaseProperties + + include MsRestAzure + + # @return [String] Email address from which the notification will be + # sent. + attr_accessor :notification_sender_email + + # @return [String] The current provisioning state of the API Management + # service which can be one of the following: + # Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + attr_accessor :provisioning_state + + # @return [String] The provisioning state of the API Management service, + # which is targeted by the long running operation started on the service. + attr_accessor :target_provisioning_state + + # @return [DateTime] Creation UTC date of the API Management service.The + # date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + # specified by the ISO 8601 standard. + attr_accessor :created_at_utc + + # @return [String] Gateway URL of the API Management service. + attr_accessor :gateway_url + + # @return [String] Gateway URL of the API Management service in the + # Default Region. + attr_accessor :gateway_regional_url + + # @return [String] Publisher portal endpoint Url of the API Management + # service. + attr_accessor :portal_url + + # @return [String] Management API endpoint URL of the API Management + # service. + attr_accessor :management_api_url + + # @return [String] SCM endpoint URL of the API Management service. + attr_accessor :scm_url + + # @return [Array] Custom hostname configuration of + # the API Management service. + attr_accessor :hostname_configurations + + # @return [Array] Public Static Load Balanced IP addresses of the + # API Management service in Primary region. Available only for Basic, + # Standard and Premium SKU. + attr_accessor :public_ipaddresses + + # @return [Array] Private Static Load Balanced IP addresses of + # the API Management service in Primary region which is deployed in an + # Internal Virtual Network. Available only for Basic, Standard and + # Premium SKU. + attr_accessor :private_ipaddresses + + # @return [VirtualNetworkConfiguration] Virtual network configuration of + # the API Management service. + attr_accessor :virtual_network_configuration + + # @return [Array] Additional datacenter locations of + # the API Management service. + attr_accessor :additional_locations + + # @return [Hash{String => String}] Custom properties of the API + # Management service. Setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + # will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, + # 1.1 and 1.2). Setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + # can be used to disable just TLS 1.1 and setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + # can be used to disable TLS 1.0 on an API Management service. + attr_accessor :custom_properties + + # @return [Array] List of Certificates that + # need to be installed in the API Management service. Max supported + # certificates that can be installed is 10. + attr_accessor :certificates + + # @return [VirtualNetworkType] The type of VPN in which API Managemet + # service needs to be configured in. None (Default Value) means the API + # Management service is not part of any Virtual Network, External means + # the API Management deployment is set up inside a Virtual Network having + # an Internet Facing Endpoint, and Internal means that API Management + # deployment is setup inside a Virtual Network having an Intranet Facing + # Endpoint only. Possible values include: 'None', 'External', 'Internal'. + # Default value: 'None' . + attr_accessor :virtual_network_type + + + # + # Mapper for ApiManagementServiceBaseProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceBaseProperties', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceBaseProperties', + model_properties: { + notification_sender_email: { + required: false, + serialized_name: 'notificationSenderEmail', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'provisioningState', + type: { + name: 'String' + } + }, + target_provisioning_state: { + required: false, + read_only: true, + serialized_name: 'targetProvisioningState', + type: { + name: 'String' + } + }, + created_at_utc: { + required: false, + read_only: true, + serialized_name: 'createdAtUtc', + type: { + name: 'DateTime' + } + }, + gateway_url: { + required: false, + read_only: true, + serialized_name: 'gatewayUrl', + type: { + name: 'String' + } + }, + gateway_regional_url: { + required: false, + read_only: true, + serialized_name: 'gatewayRegionalUrl', + type: { + name: 'String' + } + }, + portal_url: { + required: false, + read_only: true, + serialized_name: 'portalUrl', + type: { + name: 'String' + } + }, + management_api_url: { + required: false, + read_only: true, + serialized_name: 'managementApiUrl', + type: { + name: 'String' + } + }, + scm_url: { + required: false, + read_only: true, + serialized_name: 'scmUrl', + type: { + name: 'String' + } + }, + hostname_configurations: { + required: false, + serialized_name: 'hostnameConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'HostnameConfigurationElementType', + type: { + name: 'Composite', + class_name: 'HostnameConfiguration' + } + } + } + }, + public_ipaddresses: { + required: false, + read_only: true, + serialized_name: 'publicIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_ipaddresses: { + required: false, + read_only: true, + serialized_name: 'privateIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + virtual_network_configuration: { + required: false, + serialized_name: 'virtualNetworkConfiguration', + type: { + name: 'Composite', + class_name: 'VirtualNetworkConfiguration' + } + }, + additional_locations: { + required: false, + serialized_name: 'additionalLocations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'AdditionalLocationElementType', + type: { + name: 'Composite', + class_name: 'AdditionalLocation' + } + } + } + }, + custom_properties: { + required: false, + serialized_name: 'customProperties', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + certificates: { + required: false, + serialized_name: 'certificates', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'CertificateConfigurationElementType', + type: { + name: 'Composite', + class_name: 'CertificateConfiguration' + } + } + } + }, + virtual_network_type: { + required: false, + serialized_name: 'virtualNetworkType', + default_value: 'None', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb new file mode 100644 index 0000000000..fbf31276b1 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_check_name_availability_parameters.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the CheckNameAvailability operation. + # + class ApiManagementServiceCheckNameAvailabilityParameters + + include MsRestAzure + + # @return [String] The name to check for availability. + attr_accessor :name + + + # + # Mapper for ApiManagementServiceCheckNameAvailabilityParameters class as + # Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceCheckNameAvailabilityParameters', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceCheckNameAvailabilityParameters', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb new file mode 100644 index 0000000000..0b28f35f79 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_get_sso_token_result.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # The response of the GetSsoToken operation. + # + class ApiManagementServiceGetSsoTokenResult + + include MsRestAzure + + # @return [String] Redirect URL to the Publisher Portal containing the + # SSO token. + attr_accessor :redirect_uri + + + # + # Mapper for ApiManagementServiceGetSsoTokenResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceGetSsoTokenResult', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceGetSsoTokenResult', + model_properties: { + redirect_uri: { + required: false, + serialized_name: 'redirectUri', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_identity.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_identity.rb new file mode 100644 index 0000000000..af24f4bb2b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_identity.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Identity properties of the Api Management service resource. + # + class ApiManagementServiceIdentity + + include MsRestAzure + + # @return [String] The identity type. Currently the only supported type + # is 'SystemAssigned'. Default value: 'SystemAssigned' . + attr_accessor :type + + # @return The principal id of the identity. + attr_accessor :principal_id + + # @return The client tenant id of the identity. + attr_accessor :tenant_id + + + # + # Mapper for ApiManagementServiceIdentity class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceIdentity', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceIdentity', + model_properties: { + type: { + required: true, + is_constant: true, + serialized_name: 'type', + default_value: 'SystemAssigned', + type: { + name: 'String' + } + }, + principal_id: { + required: false, + read_only: true, + serialized_name: 'principalId', + type: { + name: 'String' + } + }, + tenant_id: { + required: false, + read_only: true, + serialized_name: 'tenantId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb new file mode 100644 index 0000000000..5963a0b2be --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_list_result.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # The response of the List API Management services operation. + # + class ApiManagementServiceListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Result of the List API + # Management services operation. + attr_accessor :value + + # @return [String] Link to the next set of results. Not empty if Value + # contains incomplete list of API Management services. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ApiManagementServiceListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ApiManagementServiceListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceListResult', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceListResult', + model_properties: { + value: { + required: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ApiManagementServiceResourceElementType', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceResource' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb new file mode 100644 index 0000000000..3d75a591a0 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_name_availability_result.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Response of the CheckNameAvailability operation. + # + class ApiManagementServiceNameAvailabilityResult + + include MsRestAzure + + # @return [Boolean] True if the name is available and can be used to + # create a new API Management service; otherwise false. + attr_accessor :name_available + + # @return [String] If reason == invalid, provide the user with the reason + # why the given name is invalid, and provide the resource naming + # requirements so that the user can select a valid name. If reason == + # AlreadyExists, explain that is already in use, and + # direct them to select a different name. + attr_accessor :message + + # @return [NameAvailabilityReason] Invalid indicates the name provided + # does not match the resource provider’s naming requirements (incorrect + # length, unsupported characters, etc.) AlreadyExists indicates that the + # name is already in use and is therefore unavailable. Possible values + # include: 'Valid', 'Invalid', 'AlreadyExists' + attr_accessor :reason + + + # + # Mapper for ApiManagementServiceNameAvailabilityResult class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceNameAvailabilityResult', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceNameAvailabilityResult', + model_properties: { + name_available: { + required: false, + read_only: true, + serialized_name: 'nameAvailable', + type: { + name: 'Boolean' + } + }, + message: { + required: false, + read_only: true, + serialized_name: 'message', + type: { + name: 'String' + } + }, + reason: { + required: false, + serialized_name: 'reason', + type: { + name: 'Enum', + module: 'NameAvailabilityReason' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_resource.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_resource.rb new file mode 100644 index 0000000000..9808e7fb3a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_resource.rb @@ -0,0 +1,407 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # A single API Management service resource in List or Get response. + # + class ApiManagementServiceResource < ApimResource + + include MsRestAzure + + # @return [String] Email address from which the notification will be + # sent. + attr_accessor :notification_sender_email + + # @return [String] The current provisioning state of the API Management + # service which can be one of the following: + # Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + attr_accessor :provisioning_state + + # @return [String] The provisioning state of the API Management service, + # which is targeted by the long running operation started on the service. + attr_accessor :target_provisioning_state + + # @return [DateTime] Creation UTC date of the API Management service.The + # date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + # specified by the ISO 8601 standard. + attr_accessor :created_at_utc + + # @return [String] Gateway URL of the API Management service. + attr_accessor :gateway_url + + # @return [String] Gateway URL of the API Management service in the + # Default Region. + attr_accessor :gateway_regional_url + + # @return [String] Publisher portal endpoint Url of the API Management + # service. + attr_accessor :portal_url + + # @return [String] Management API endpoint URL of the API Management + # service. + attr_accessor :management_api_url + + # @return [String] SCM endpoint URL of the API Management service. + attr_accessor :scm_url + + # @return [Array] Custom hostname configuration of + # the API Management service. + attr_accessor :hostname_configurations + + # @return [Array] Public Static Load Balanced IP addresses of the + # API Management service in Primary region. Available only for Basic, + # Standard and Premium SKU. + attr_accessor :public_ipaddresses + + # @return [Array] Private Static Load Balanced IP addresses of + # the API Management service in Primary region which is deployed in an + # Internal Virtual Network. Available only for Basic, Standard and + # Premium SKU. + attr_accessor :private_ipaddresses + + # @return [VirtualNetworkConfiguration] Virtual network configuration of + # the API Management service. + attr_accessor :virtual_network_configuration + + # @return [Array] Additional datacenter locations of + # the API Management service. + attr_accessor :additional_locations + + # @return [Hash{String => String}] Custom properties of the API + # Management service. Setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + # will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, + # 1.1 and 1.2). Setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + # can be used to disable just TLS 1.1 and setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + # can be used to disable TLS 1.0 on an API Management service. + attr_accessor :custom_properties + + # @return [Array] List of Certificates that + # need to be installed in the API Management service. Max supported + # certificates that can be installed is 10. + attr_accessor :certificates + + # @return [VirtualNetworkType] The type of VPN in which API Managemet + # service needs to be configured in. None (Default Value) means the API + # Management service is not part of any Virtual Network, External means + # the API Management deployment is set up inside a Virtual Network having + # an Internet Facing Endpoint, and Internal means that API Management + # deployment is setup inside a Virtual Network having an Intranet Facing + # Endpoint only. Possible values include: 'None', 'External', 'Internal'. + # Default value: 'None' . + attr_accessor :virtual_network_type + + # @return [String] Publisher email. + attr_accessor :publisher_email + + # @return [String] Publisher name. + attr_accessor :publisher_name + + # @return [ApiManagementServiceSkuProperties] SKU properties of the API + # Management service. + attr_accessor :sku + + # @return [ApiManagementServiceIdentity] Managed service identity of the + # Api Management service. + attr_accessor :identity + + # @return [String] Resource location. + attr_accessor :location + + # @return [String] ETag of the resource. + attr_accessor :etag + + + # + # Mapper for ApiManagementServiceResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceResource', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceResource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notification_sender_email: { + required: false, + serialized_name: 'properties.notificationSenderEmail', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + target_provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.targetProvisioningState', + type: { + name: 'String' + } + }, + created_at_utc: { + required: false, + read_only: true, + serialized_name: 'properties.createdAtUtc', + type: { + name: 'DateTime' + } + }, + gateway_url: { + required: false, + read_only: true, + serialized_name: 'properties.gatewayUrl', + type: { + name: 'String' + } + }, + gateway_regional_url: { + required: false, + read_only: true, + serialized_name: 'properties.gatewayRegionalUrl', + type: { + name: 'String' + } + }, + portal_url: { + required: false, + read_only: true, + serialized_name: 'properties.portalUrl', + type: { + name: 'String' + } + }, + management_api_url: { + required: false, + read_only: true, + serialized_name: 'properties.managementApiUrl', + type: { + name: 'String' + } + }, + scm_url: { + required: false, + read_only: true, + serialized_name: 'properties.scmUrl', + type: { + name: 'String' + } + }, + hostname_configurations: { + required: false, + serialized_name: 'properties.hostnameConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'HostnameConfigurationElementType', + type: { + name: 'Composite', + class_name: 'HostnameConfiguration' + } + } + } + }, + public_ipaddresses: { + required: false, + read_only: true, + serialized_name: 'properties.publicIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_ipaddresses: { + required: false, + read_only: true, + serialized_name: 'properties.privateIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + virtual_network_configuration: { + required: false, + serialized_name: 'properties.virtualNetworkConfiguration', + type: { + name: 'Composite', + class_name: 'VirtualNetworkConfiguration' + } + }, + additional_locations: { + required: false, + serialized_name: 'properties.additionalLocations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'AdditionalLocationElementType', + type: { + name: 'Composite', + class_name: 'AdditionalLocation' + } + } + } + }, + custom_properties: { + required: false, + serialized_name: 'properties.customProperties', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + certificates: { + required: false, + serialized_name: 'properties.certificates', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'CertificateConfigurationElementType', + type: { + name: 'Composite', + class_name: 'CertificateConfiguration' + } + } + } + }, + virtual_network_type: { + required: false, + serialized_name: 'properties.virtualNetworkType', + default_value: 'None', + type: { + name: 'String' + } + }, + publisher_email: { + required: true, + serialized_name: 'properties.publisherEmail', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + publisher_name: { + required: true, + serialized_name: 'properties.publisherName', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + sku: { + required: true, + serialized_name: 'sku', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceSkuProperties' + } + }, + identity: { + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceIdentity' + } + }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + etag: { + required: false, + read_only: true, + serialized_name: 'etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb new file mode 100644 index 0000000000..fbb0daa058 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_sku_properties.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API Management service resource SKU properties. + # + class ApiManagementServiceSkuProperties + + include MsRestAzure + + # @return [SkuType] Name of the Sku. Possible values include: + # 'Developer', 'Standard', 'Premium', 'Basic' + attr_accessor :name + + # @return [Integer] Capacity of the SKU (number of deployed units of the + # SKU). The default value is 1. Default value: 1 . + attr_accessor :capacity + + + # + # Mapper for ApiManagementServiceSkuProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceSkuProperties', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceSkuProperties', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serialized_name: 'capacity', + default_value: 1, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb new file mode 100644 index 0000000000..67dd045c94 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_update_hostname_parameters.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the UpdateHostname operation. + # + class ApiManagementServiceUpdateHostnameParameters + + include MsRestAzure + + # @return [Array] Hostnames to create or + # update. + attr_accessor :update + + # @return [Array] Hostnames types to delete. + attr_accessor :delete + + + # + # Mapper for ApiManagementServiceUpdateHostnameParameters class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceUpdateHostnameParameters', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceUpdateHostnameParameters', + model_properties: { + update: { + required: false, + serialized_name: 'update', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'HostnameConfigurationOldElementType', + type: { + name: 'Composite', + class_name: 'HostnameConfigurationOld' + } + } + } + }, + delete: { + required: false, + serialized_name: 'delete', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'HostnameTypeElementType', + type: { + name: 'Enum', + module: 'HostnameType' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_update_parameters.rb new file mode 100644 index 0000000000..1bd0565464 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_update_parameters.rb @@ -0,0 +1,397 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameter supplied to Update Api Management Service. + # + class ApiManagementServiceUpdateParameters < ApimResource + + include MsRestAzure + + # @return [String] Email address from which the notification will be + # sent. + attr_accessor :notification_sender_email + + # @return [String] The current provisioning state of the API Management + # service which can be one of the following: + # Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + attr_accessor :provisioning_state + + # @return [String] The provisioning state of the API Management service, + # which is targeted by the long running operation started on the service. + attr_accessor :target_provisioning_state + + # @return [DateTime] Creation UTC date of the API Management service.The + # date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + # specified by the ISO 8601 standard. + attr_accessor :created_at_utc + + # @return [String] Gateway URL of the API Management service. + attr_accessor :gateway_url + + # @return [String] Gateway URL of the API Management service in the + # Default Region. + attr_accessor :gateway_regional_url + + # @return [String] Publisher portal endpoint Url of the API Management + # service. + attr_accessor :portal_url + + # @return [String] Management API endpoint URL of the API Management + # service. + attr_accessor :management_api_url + + # @return [String] SCM endpoint URL of the API Management service. + attr_accessor :scm_url + + # @return [Array] Custom hostname configuration of + # the API Management service. + attr_accessor :hostname_configurations + + # @return [Array] Public Static Load Balanced IP addresses of the + # API Management service in Primary region. Available only for Basic, + # Standard and Premium SKU. + attr_accessor :public_ipaddresses + + # @return [Array] Private Static Load Balanced IP addresses of + # the API Management service in Primary region which is deployed in an + # Internal Virtual Network. Available only for Basic, Standard and + # Premium SKU. + attr_accessor :private_ipaddresses + + # @return [VirtualNetworkConfiguration] Virtual network configuration of + # the API Management service. + attr_accessor :virtual_network_configuration + + # @return [Array] Additional datacenter locations of + # the API Management service. + attr_accessor :additional_locations + + # @return [Hash{String => String}] Custom properties of the API + # Management service. Setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + # will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, + # 1.1 and 1.2). Setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + # can be used to disable just TLS 1.1 and setting + # `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + # can be used to disable TLS 1.0 on an API Management service. + attr_accessor :custom_properties + + # @return [Array] List of Certificates that + # need to be installed in the API Management service. Max supported + # certificates that can be installed is 10. + attr_accessor :certificates + + # @return [VirtualNetworkType] The type of VPN in which API Managemet + # service needs to be configured in. None (Default Value) means the API + # Management service is not part of any Virtual Network, External means + # the API Management deployment is set up inside a Virtual Network having + # an Internet Facing Endpoint, and Internal means that API Management + # deployment is setup inside a Virtual Network having an Intranet Facing + # Endpoint only. Possible values include: 'None', 'External', 'Internal'. + # Default value: 'None' . + attr_accessor :virtual_network_type + + # @return [String] Publisher email. + attr_accessor :publisher_email + + # @return [String] Publisher name. + attr_accessor :publisher_name + + # @return [ApiManagementServiceSkuProperties] SKU properties of the API + # Management service. + attr_accessor :sku + + # @return [ApiManagementServiceIdentity] Managed service identity of the + # Api Management service. + attr_accessor :identity + + # @return [String] ETag of the resource. + attr_accessor :etag + + + # + # Mapper for ApiManagementServiceUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceUpdateParameters', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceUpdateParameters', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notification_sender_email: { + required: false, + serialized_name: 'properties.notificationSenderEmail', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + target_provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.targetProvisioningState', + type: { + name: 'String' + } + }, + created_at_utc: { + required: false, + read_only: true, + serialized_name: 'properties.createdAtUtc', + type: { + name: 'DateTime' + } + }, + gateway_url: { + required: false, + read_only: true, + serialized_name: 'properties.gatewayUrl', + type: { + name: 'String' + } + }, + gateway_regional_url: { + required: false, + read_only: true, + serialized_name: 'properties.gatewayRegionalUrl', + type: { + name: 'String' + } + }, + portal_url: { + required: false, + read_only: true, + serialized_name: 'properties.portalUrl', + type: { + name: 'String' + } + }, + management_api_url: { + required: false, + read_only: true, + serialized_name: 'properties.managementApiUrl', + type: { + name: 'String' + } + }, + scm_url: { + required: false, + read_only: true, + serialized_name: 'properties.scmUrl', + type: { + name: 'String' + } + }, + hostname_configurations: { + required: false, + serialized_name: 'properties.hostnameConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'HostnameConfigurationElementType', + type: { + name: 'Composite', + class_name: 'HostnameConfiguration' + } + } + } + }, + public_ipaddresses: { + required: false, + read_only: true, + serialized_name: 'properties.publicIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_ipaddresses: { + required: false, + read_only: true, + serialized_name: 'properties.privateIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + virtual_network_configuration: { + required: false, + serialized_name: 'properties.virtualNetworkConfiguration', + type: { + name: 'Composite', + class_name: 'VirtualNetworkConfiguration' + } + }, + additional_locations: { + required: false, + serialized_name: 'properties.additionalLocations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'AdditionalLocationElementType', + type: { + name: 'Composite', + class_name: 'AdditionalLocation' + } + } + } + }, + custom_properties: { + required: false, + serialized_name: 'properties.customProperties', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + certificates: { + required: false, + serialized_name: 'properties.certificates', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'CertificateConfigurationElementType', + type: { + name: 'Composite', + class_name: 'CertificateConfiguration' + } + } + } + }, + virtual_network_type: { + required: false, + serialized_name: 'properties.virtualNetworkType', + default_value: 'None', + type: { + name: 'String' + } + }, + publisher_email: { + required: false, + serialized_name: 'properties.publisherEmail', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + publisher_name: { + required: false, + serialized_name: 'properties.publisherName', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + sku: { + required: false, + serialized_name: 'sku', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceSkuProperties' + } + }, + identity: { + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceIdentity' + } + }, + etag: { + required: false, + read_only: true, + serialized_name: 'etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb new file mode 100644 index 0000000000..85fdf22017 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_management_service_upload_certificate_parameters.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Upload SSL certificate for an API Management + # service operation. + # + class ApiManagementServiceUploadCertificateParameters + + include MsRestAzure + + # @return [HostnameType] Hostname type. Possible values include: 'Proxy', + # 'Portal', 'Management', 'Scm' + attr_accessor :type + + # @return [String] Base64 Encoded certificate. + attr_accessor :certificate + + # @return [String] Certificate password. + attr_accessor :certificate_password + + + # + # Mapper for ApiManagementServiceUploadCertificateParameters class as + # Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiManagementServiceUploadCertificateParameters', + type: { + name: 'Composite', + class_name: 'ApiManagementServiceUploadCertificateParameters', + model_properties: { + type: { + required: true, + serialized_name: 'type', + type: { + name: 'Enum', + module: 'HostnameType' + } + }, + certificate: { + required: true, + serialized_name: 'certificate', + type: { + name: 'String' + } + }, + certificate_password: { + required: true, + serialized_name: 'certificate_password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_release_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_release_collection.rb new file mode 100644 index 0000000000..2e83dd4007 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_release_collection.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Api Revision list representation. + # + class ApiReleaseCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ApiReleaseCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ApiReleaseCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiReleaseCollection', + type: { + name: 'Composite', + class_name: 'ApiReleaseCollection', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ApiReleaseContractElementType', + type: { + name: 'Composite', + class_name: 'ApiReleaseContract' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_release_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_release_contract.rb new file mode 100644 index 0000000000..a9a810cc75 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_release_contract.rb @@ -0,0 +1,102 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Api Release details. + # + class ApiReleaseContract < Resource + + include MsRestAzure + + # @return [String] Identifier of the API the release belongs to. + attr_accessor :api_id + + # @return [DateTime] The time the API was released. The date conforms to + # the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + # standard. + attr_accessor :created_date_time + + # @return [DateTime] The time the API release was updated. + attr_accessor :updated_date_time + + # @return [String] Release Notes + attr_accessor :notes + + + # + # Mapper for ApiReleaseContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiReleaseContract', + type: { + name: 'Composite', + class_name: 'ApiReleaseContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + api_id: { + required: false, + serialized_name: 'properties.apiId', + type: { + name: 'String' + } + }, + created_date_time: { + required: false, + read_only: true, + serialized_name: 'properties.createdDateTime', + type: { + name: 'DateTime' + } + }, + updated_date_time: { + required: false, + read_only: true, + serialized_name: 'properties.updatedDateTime', + type: { + name: 'DateTime' + } + }, + notes: { + required: false, + serialized_name: 'properties.notes', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_collection.rb new file mode 100644 index 0000000000..617f4ac53d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_collection.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Api Revision list representation. + # + class ApiRevisionCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ApiRevisionCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ApiRevisionCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiRevisionCollection', + type: { + name: 'Composite', + class_name: 'ApiRevisionCollection', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ApiRevisionContractElementType', + type: { + name: 'Composite', + class_name: 'ApiRevisionContract' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_contract.rb new file mode 100644 index 0000000000..aa2f1b1671 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_contract.rb @@ -0,0 +1,136 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Summary of revision metadata. + # + class ApiRevisionContract + + include MsRestAzure + + # @return [String] Identifier of the API Revision. + attr_accessor :api_id + + # @return [String] Revision number of API. + attr_accessor :api_revision + + # @return [DateTime] The time the API Revision was created. The date + # conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + # the ISO 8601 standard. + attr_accessor :created_date_time + + # @return [DateTime] The time the API Revision were updated. The date + # conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + # the ISO 8601 standard. + attr_accessor :updated_date_time + + # @return [String] Description of the API Revision. + attr_accessor :description + + # @return [String] Gateway URL for accessing the non-current API + # Revision. + attr_accessor :private_url + + # @return [Boolean] Indicates if API revision is the current api + # revision. + attr_accessor :is_online + + # @return [Boolean] Indicates if API revision is accessible via the + # gateway. + attr_accessor :is_current + + + # + # Mapper for ApiRevisionContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiRevisionContract', + type: { + name: 'Composite', + class_name: 'ApiRevisionContract', + model_properties: { + api_id: { + required: false, + read_only: true, + serialized_name: 'apiId', + type: { + name: 'String' + } + }, + api_revision: { + required: false, + read_only: true, + serialized_name: 'apiRevision', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + created_date_time: { + required: false, + read_only: true, + serialized_name: 'createdDateTime', + type: { + name: 'DateTime' + } + }, + updated_date_time: { + required: false, + read_only: true, + serialized_name: 'updatedDateTime', + type: { + name: 'DateTime' + } + }, + description: { + required: false, + read_only: true, + serialized_name: 'description', + constraints: { + MaxLength: 256 + }, + type: { + name: 'String' + } + }, + private_url: { + required: false, + read_only: true, + serialized_name: 'privateUrl', + type: { + name: 'String' + } + }, + is_online: { + required: false, + read_only: true, + serialized_name: 'isOnline', + type: { + name: 'Boolean' + } + }, + is_current: { + required: false, + read_only: true, + serialized_name: 'isCurrent', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_info_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_info_contract.rb new file mode 100644 index 0000000000..6065475ade --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_revision_info_contract.rb @@ -0,0 +1,83 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Object used to create an API Revision or Version based on an existing API + # Revision + # + class ApiRevisionInfoContract + + include MsRestAzure + + # @return [String] Resource identifier of API to be used to create the + # revision from. + attr_accessor :source_api_id + + # @return [String] Version identifier for the new API Version. + attr_accessor :api_version_name + + # @return [String] Description of new API Revision. + attr_accessor :api_revision_description + + # @return [ApiVersionSetContractDetails] Version set details + attr_accessor :api_version_set + + + # + # Mapper for ApiRevisionInfoContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiRevisionInfoContract', + type: { + name: 'Composite', + class_name: 'ApiRevisionInfoContract', + model_properties: { + source_api_id: { + required: false, + serialized_name: 'sourceApiId', + type: { + name: 'String' + } + }, + api_version_name: { + required: false, + serialized_name: 'apiVersionName', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + api_revision_description: { + required: false, + serialized_name: 'apiRevisionDescription', + constraints: { + MaxLength: 256 + }, + type: { + name: 'String' + } + }, + api_version_set: { + required: false, + serialized_name: 'apiVersionSet', + type: { + name: 'Composite', + class_name: 'ApiVersionSetContractDetails' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_tag_resource_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_tag_resource_contract_properties.rb new file mode 100644 index 0000000000..84f5900bd7 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_tag_resource_contract_properties.rb @@ -0,0 +1,183 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API contract properties for the Tag Resources. + # + class ApiTagResourceContractProperties < ApiEntityBaseContract + + include MsRestAzure + + # @return [String] API identifier in the form /apis/{apiId}. + attr_accessor :id + + # @return [String] API name. + attr_accessor :name + + # @return [String] Absolute URL of the backend service implementing this + # API. + attr_accessor :service_url + + # @return [String] Relative URL uniquely identifying this API and all of + # its resource paths within the API Management service instance. It is + # appended to the API endpoint base URL specified during the service + # instance creation to form a public URL for this API. + attr_accessor :path + + # @return [Array] Describes on which protocols the operations + # in this API can be invoked. + attr_accessor :protocols + + + # + # Mapper for ApiTagResourceContractProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiTagResourceContractProperties', + type: { + name: 'Composite', + class_name: 'ApiTagResourceContractProperties', + model_properties: { + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + authentication_settings: { + required: false, + serialized_name: 'authenticationSettings', + type: { + name: 'Composite', + class_name: 'AuthenticationSettingsContract' + } + }, + subscription_key_parameter_names: { + required: false, + serialized_name: 'subscriptionKeyParameterNames', + type: { + name: 'Composite', + class_name: 'SubscriptionKeyParameterNamesContract' + } + }, + api_type: { + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + api_revision: { + required: false, + serialized_name: 'apiRevision', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + api_version: { + required: false, + serialized_name: 'apiVersion', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + is_current: { + required: false, + read_only: true, + serialized_name: 'isCurrent', + type: { + name: 'Boolean' + } + }, + is_online: { + required: false, + read_only: true, + serialized_name: 'isOnline', + type: { + name: 'Boolean' + } + }, + api_version_set_id: { + required: false, + serialized_name: 'apiVersionSetId', + type: { + name: 'String' + } + }, + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serialized_name: 'name', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + service_url: { + required: false, + serialized_name: 'serviceUrl', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + path: { + required: false, + serialized_name: 'path', + constraints: { + MaxLength: 400, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + protocols: { + required: false, + serialized_name: 'protocols', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ProtocolElementType', + type: { + name: 'Enum', + module: 'Protocol' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_type.rb new file mode 100644 index 0000000000..a7cde64218 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for ApiType + # + module ApiType + Http = "http" + Soap = "soap" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_update_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_update_contract.rb new file mode 100644 index 0000000000..3bc207bad2 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_update_contract.rb @@ -0,0 +1,206 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API update contract details. + # + class ApiUpdateContract + + include MsRestAzure + + # @return [String] Description of the API. May include HTML formatting + # tags. + attr_accessor :description + + # @return [AuthenticationSettingsContract] Collection of authentication + # settings included into this API. + attr_accessor :authentication_settings + + # @return [SubscriptionKeyParameterNamesContract] Protocols over which + # API is made available. + attr_accessor :subscription_key_parameter_names + + # @return [ApiType] Type of API. Possible values include: 'http', 'soap' + attr_accessor :api_type + + # @return [String] Describes the Revision of the Api. If no value is + # provided, default revision 1 is created + attr_accessor :api_revision + + # @return [String] Indicates the Version identifier of the API if the API + # is versioned + attr_accessor :api_version + + # @return [Boolean] Indicates if API revision is current api revision. + attr_accessor :is_current + + # @return [Boolean] Indicates if API revision is accessible via the + # gateway. + attr_accessor :is_online + + # @return [String] A resource identifier for the related ApiVersionSet. + attr_accessor :api_version_set_id + + # @return [String] API name. + attr_accessor :display_name + + # @return [String] Absolute URL of the backend service implementing this + # API. + attr_accessor :service_url + + # @return [String] Relative URL uniquely identifying this API and all of + # its resource paths within the API Management service instance. It is + # appended to the API endpoint base URL specified during the service + # instance creation to form a public URL for this API. + attr_accessor :path + + # @return [Array] Describes on which protocols the operations + # in this API can be invoked. + attr_accessor :protocols + + + # + # Mapper for ApiUpdateContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiUpdateContract', + type: { + name: 'Composite', + class_name: 'ApiUpdateContract', + model_properties: { + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + authentication_settings: { + required: false, + serialized_name: 'properties.authenticationSettings', + type: { + name: 'Composite', + class_name: 'AuthenticationSettingsContract' + } + }, + subscription_key_parameter_names: { + required: false, + serialized_name: 'properties.subscriptionKeyParameterNames', + type: { + name: 'Composite', + class_name: 'SubscriptionKeyParameterNamesContract' + } + }, + api_type: { + required: false, + serialized_name: 'properties.type', + type: { + name: 'String' + } + }, + api_revision: { + required: false, + serialized_name: 'properties.apiRevision', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + api_version: { + required: false, + serialized_name: 'properties.apiVersion', + constraints: { + MaxLength: 100 + }, + type: { + name: 'String' + } + }, + is_current: { + required: false, + read_only: true, + serialized_name: 'properties.isCurrent', + type: { + name: 'Boolean' + } + }, + is_online: { + required: false, + read_only: true, + serialized_name: 'properties.isOnline', + type: { + name: 'Boolean' + } + }, + api_version_set_id: { + required: false, + serialized_name: 'properties.apiVersionSetId', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + service_url: { + required: false, + serialized_name: 'properties.serviceUrl', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + path: { + required: false, + serialized_name: 'properties.path', + constraints: { + MaxLength: 400, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + protocols: { + required: false, + serialized_name: 'properties.protocols', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ProtocolElementType', + type: { + name: 'Enum', + module: 'Protocol' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_collection.rb new file mode 100644 index 0000000000..33cf492797 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Api Version Set list representation. + # + class ApiVersionSetCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ApiVersionSetCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ApiVersionSetCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiVersionSetCollection', + type: { + name: 'Composite', + class_name: 'ApiVersionSetCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ApiVersionSetContractElementType', + type: { + name: 'Composite', + class_name: 'ApiVersionSetContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_contract.rb new file mode 100644 index 0000000000..13def1d63c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_contract.rb @@ -0,0 +1,124 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Api Version Set Contract details. + # + class ApiVersionSetContract < Resource + + include MsRestAzure + + # @return [String] Description of API Version Set. + attr_accessor :description + + # @return [String] Name of query parameter that indicates the API Version + # if versioningScheme is set to `query`. + attr_accessor :version_query_name + + # @return [String] Name of HTTP header parameter that indicates the API + # Version if versioningScheme is set to `header`. + attr_accessor :version_header_name + + # @return [String] Name of API Version Set + attr_accessor :display_name + + # @return [VersioningScheme] An value that determines where the API + # Version identifer will be located in a HTTP request. Possible values + # include: 'Segment', 'Query', 'Header' + attr_accessor :versioning_scheme + + + # + # Mapper for ApiVersionSetContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiVersionSetContract', + type: { + name: 'Composite', + class_name: 'ApiVersionSetContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + version_query_name: { + required: false, + serialized_name: 'properties.versionQueryName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + version_header_name: { + required: false, + serialized_name: 'properties.versionHeaderName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + versioning_scheme: { + required: true, + serialized_name: 'properties.versioningScheme', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_contract_details.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_contract_details.rb new file mode 100644 index 0000000000..0a8809ce2b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_contract_details.rb @@ -0,0 +1,90 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # An API Version Set contains the common configuration for a set of API + # Versions relating + # + class ApiVersionSetContractDetails + + include MsRestAzure + + # @return [String] Identifier for existing API Version Set. Omit this + # value to create a new Version Set. + attr_accessor :id + + # @return [String] Description of API Version Set. + attr_accessor :description + + # @return [Enum] An value that determines where the API Version identifer + # will be located in a HTTP request. Possible values include: 'Segment', + # 'Query', 'Header' + attr_accessor :versioning_scheme + + # @return [String] Name of query parameter that indicates the API Version + # if versioningScheme is set to `query`. + attr_accessor :version_query_name + + # @return [String] Name of HTTP header parameter that indicates the API + # Version if versioningScheme is set to `header`. + attr_accessor :version_header_name + + + # + # Mapper for ApiVersionSetContractDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiVersionSetContractDetails', + type: { + name: 'Composite', + class_name: 'ApiVersionSetContractDetails', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + versioning_scheme: { + required: false, + serialized_name: 'versioningScheme', + type: { + name: 'String' + } + }, + version_query_name: { + required: false, + serialized_name: 'versionQueryName', + type: { + name: 'String' + } + }, + version_header_name: { + required: false, + serialized_name: 'versionHeaderName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_entity_base.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_entity_base.rb new file mode 100644 index 0000000000..5fe5f8b4bb --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_entity_base.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Api Version set base parameters + # + class ApiVersionSetEntityBase + + include MsRestAzure + + # @return [String] Description of API Version Set. + attr_accessor :description + + # @return [String] Name of query parameter that indicates the API Version + # if versioningScheme is set to `query`. + attr_accessor :version_query_name + + # @return [String] Name of HTTP header parameter that indicates the API + # Version if versioningScheme is set to `header`. + attr_accessor :version_header_name + + + # + # Mapper for ApiVersionSetEntityBase class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiVersionSetEntityBase', + type: { + name: 'Composite', + class_name: 'ApiVersionSetEntityBase', + model_properties: { + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + version_query_name: { + required: false, + serialized_name: 'versionQueryName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + version_header_name: { + required: false, + serialized_name: 'versionHeaderName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_update_parameters.rb new file mode 100644 index 0000000000..3b3d1f98c3 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/api_version_set_update_parameters.rb @@ -0,0 +1,100 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters to update or create an Api Version Set Contract. + # + class ApiVersionSetUpdateParameters + + include MsRestAzure + + # @return [String] Description of API Version Set. + attr_accessor :description + + # @return [String] Name of query parameter that indicates the API Version + # if versioningScheme is set to `query`. + attr_accessor :version_query_name + + # @return [String] Name of HTTP header parameter that indicates the API + # Version if versioningScheme is set to `header`. + attr_accessor :version_header_name + + # @return [String] Name of API Version Set + attr_accessor :display_name + + # @return [VersioningScheme] An value that determines where the API + # Version identifer will be located in a HTTP request. Possible values + # include: 'Segment', 'Query', 'Header' + attr_accessor :versioning_scheme + + + # + # Mapper for ApiVersionSetUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApiVersionSetUpdateParameters', + type: { + name: 'Composite', + class_name: 'ApiVersionSetUpdateParameters', + model_properties: { + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + version_query_name: { + required: false, + serialized_name: 'properties.versionQueryName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + version_header_name: { + required: false, + serialized_name: 'properties.versionHeaderName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + versioning_scheme: { + required: false, + serialized_name: 'properties.versioningScheme', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/apim_resource.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/apim_resource.rb new file mode 100644 index 0000000000..baffdc7450 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/apim_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # The Resource definition. + # + class ApimResource + + include MsRestAzure + + # @return [String] Resource ID. + attr_accessor :id + + # @return [String] Resource name. + attr_accessor :name + + # @return [String] Resource type for API Management resource is set to + # Microsoft.ApiManagement. + attr_accessor :type + + # @return [Hash{String => String}] Resource tags. + attr_accessor :tags + + + # + # Mapper for ApimResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApimResource', + type: { + name: 'Composite', + class_name: 'ApimResource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/async_operation_status.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/async_operation_status.rb new file mode 100644 index 0000000000..2a36e02b79 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/async_operation_status.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for AsyncOperationStatus + # + module AsyncOperationStatus + Started = "Started" + InProgress = "InProgress" + Succeeded = "Succeeded" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb new file mode 100644 index 0000000000..a7cf06ae80 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authentication_settings_contract.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API Authentication Settings. + # + class AuthenticationSettingsContract + + include MsRestAzure + + # @return [OAuth2AuthenticationSettingsContract] OAuth2 Authentication + # settings + attr_accessor :o_auth2 + + + # + # Mapper for AuthenticationSettingsContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AuthenticationSettingsContract', + type: { + name: 'Composite', + class_name: 'AuthenticationSettingsContract', + model_properties: { + o_auth2: { + required: false, + serialized_name: 'oAuth2', + type: { + name: 'Composite', + class_name: 'OAuth2AuthenticationSettingsContract' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_method.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_method.rb new file mode 100644 index 0000000000..bdc8d6b2e4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_method.rb @@ -0,0 +1,22 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for AuthorizationMethod + # + module AuthorizationMethod + HEAD = "HEAD" + OPTIONS = "OPTIONS" + TRACE = "TRACE" + GET = "GET" + POST = "POST" + PUT = "PUT" + PATCH = "PATCH" + DELETE = "DELETE" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_collection.rb new file mode 100644 index 0000000000..2a36fea752 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_collection.rb @@ -0,0 +1,104 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged OAuth2 Authorization Servers list representation. + # + class AuthorizationServerCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [Integer] Total record count number across all pages. + attr_accessor :count + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [AuthorizationServerCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for AuthorizationServerCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AuthorizationServerCollection', + type: { + name: 'Composite', + class_name: 'AuthorizationServerCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'AuthorizationServerContractElementType', + type: { + name: 'Composite', + class_name: 'AuthorizationServerContract' + } + } + } + }, + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_contract.rb new file mode 100644 index 0000000000..a87780d2f1 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_contract.rb @@ -0,0 +1,284 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # External OAuth authorization server settings. + # + class AuthorizationServerContract < Resource + + include MsRestAzure + + # @return [String] Description of the authorization server. Can contain + # HTML formatting tags. + attr_accessor :description + + # @return [Array] HTTP verbs supported by the + # authorization endpoint. GET must be always present. POST is optional. + attr_accessor :authorization_methods + + # @return [Array] Method of authentication + # supported by the token endpoint of this authorization server. Possible + # values are Basic and/or Body. When Body is specified, client + # credentials and other parameters are passed within the request body in + # the application/x-www-form-urlencoded format. + attr_accessor :client_authentication_method + + # @return [Array] Additional parameters + # required by the token endpoint of this authorization server represented + # as an array of JSON objects with name and value string properties, i.e. + # {"name" : "name value", "value": "a value"}. + attr_accessor :token_body_parameters + + # @return [String] OAuth token endpoint. Contains absolute URI to entity + # being referenced. + attr_accessor :token_endpoint + + # @return [Boolean] If true, authorization server will include state + # parameter from the authorization request to its response. Client may + # use state parameter to raise protocol security. + attr_accessor :support_state + + # @return [String] Access token scope that is going to be requested by + # default. Can be overridden at the API level. Should be provided in the + # form of a string containing space-delimited values. + attr_accessor :default_scope + + # @return [Array] Specifies the mechanism by + # which access token is passed to the API. + attr_accessor :bearer_token_sending_methods + + # @return [String] Client or app secret registered with this + # authorization server. + attr_accessor :client_secret + + # @return [String] Can be optionally specified when resource owner + # password grant type is supported by this authorization server. Default + # resource owner username. + attr_accessor :resource_owner_username + + # @return [String] Can be optionally specified when resource owner + # password grant type is supported by this authorization server. Default + # resource owner password. + attr_accessor :resource_owner_password + + # @return [String] User-friendly authorization server name. + attr_accessor :display_name + + # @return [String] Optional reference to a page where client or app + # registration for this authorization server is performed. Contains + # absolute URL to entity being referenced. + attr_accessor :client_registration_endpoint + + # @return [String] OAuth authorization endpoint. See + # http://tools.ietf.org/html/rfc6749#section-3.2. + attr_accessor :authorization_endpoint + + # @return [Array] Form of an authorization grant, which the + # client uses to request the access token. + attr_accessor :grant_types + + # @return [String] Client or app id registered with this authorization + # server. + attr_accessor :client_id + + + # + # Mapper for AuthorizationServerContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AuthorizationServerContract', + type: { + name: 'Composite', + class_name: 'AuthorizationServerContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + authorization_methods: { + required: false, + serialized_name: 'properties.authorizationMethods', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'AuthorizationMethodElementType', + type: { + name: 'Enum', + module: 'AuthorizationMethod' + } + } + } + }, + client_authentication_method: { + required: false, + serialized_name: 'properties.clientAuthenticationMethod', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ClientAuthenticationMethodElementType', + type: { + name: 'String' + } + } + } + }, + token_body_parameters: { + required: false, + serialized_name: 'properties.tokenBodyParameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'TokenBodyParameterContractElementType', + type: { + name: 'Composite', + class_name: 'TokenBodyParameterContract' + } + } + } + }, + token_endpoint: { + required: false, + serialized_name: 'properties.tokenEndpoint', + type: { + name: 'String' + } + }, + support_state: { + required: false, + serialized_name: 'properties.supportState', + type: { + name: 'Boolean' + } + }, + default_scope: { + required: false, + serialized_name: 'properties.defaultScope', + type: { + name: 'String' + } + }, + bearer_token_sending_methods: { + required: false, + serialized_name: 'properties.bearerTokenSendingMethods', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'BearerTokenSendingMethodElementType', + type: { + name: 'String' + } + } + } + }, + client_secret: { + required: false, + serialized_name: 'properties.clientSecret', + type: { + name: 'String' + } + }, + resource_owner_username: { + required: false, + serialized_name: 'properties.resourceOwnerUsername', + type: { + name: 'String' + } + }, + resource_owner_password: { + required: false, + serialized_name: 'properties.resourceOwnerPassword', + type: { + name: 'String' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 50, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + client_registration_endpoint: { + required: true, + serialized_name: 'properties.clientRegistrationEndpoint', + type: { + name: 'String' + } + }, + authorization_endpoint: { + required: true, + serialized_name: 'properties.authorizationEndpoint', + type: { + name: 'String' + } + }, + grant_types: { + required: true, + serialized_name: 'properties.grantTypes', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'GrantTypeElementType', + type: { + name: 'String' + } + } + } + }, + client_id: { + required: true, + serialized_name: 'properties.clientId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_contract_base_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_contract_base_properties.rb new file mode 100644 index 0000000000..0cfa39294c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_contract_base_properties.rb @@ -0,0 +1,195 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # External OAuth authorization server Update settings contract. + # + class AuthorizationServerContractBaseProperties + + include MsRestAzure + + # @return [String] Description of the authorization server. Can contain + # HTML formatting tags. + attr_accessor :description + + # @return [Array] HTTP verbs supported by the + # authorization endpoint. GET must be always present. POST is optional. + attr_accessor :authorization_methods + + # @return [Array] Method of authentication + # supported by the token endpoint of this authorization server. Possible + # values are Basic and/or Body. When Body is specified, client + # credentials and other parameters are passed within the request body in + # the application/x-www-form-urlencoded format. + attr_accessor :client_authentication_method + + # @return [Array] Additional parameters + # required by the token endpoint of this authorization server represented + # as an array of JSON objects with name and value string properties, i.e. + # {"name" : "name value", "value": "a value"}. + attr_accessor :token_body_parameters + + # @return [String] OAuth token endpoint. Contains absolute URI to entity + # being referenced. + attr_accessor :token_endpoint + + # @return [Boolean] If true, authorization server will include state + # parameter from the authorization request to its response. Client may + # use state parameter to raise protocol security. + attr_accessor :support_state + + # @return [String] Access token scope that is going to be requested by + # default. Can be overridden at the API level. Should be provided in the + # form of a string containing space-delimited values. + attr_accessor :default_scope + + # @return [Array] Specifies the mechanism by + # which access token is passed to the API. + attr_accessor :bearer_token_sending_methods + + # @return [String] Client or app secret registered with this + # authorization server. + attr_accessor :client_secret + + # @return [String] Can be optionally specified when resource owner + # password grant type is supported by this authorization server. Default + # resource owner username. + attr_accessor :resource_owner_username + + # @return [String] Can be optionally specified when resource owner + # password grant type is supported by this authorization server. Default + # resource owner password. + attr_accessor :resource_owner_password + + + # + # Mapper for AuthorizationServerContractBaseProperties class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AuthorizationServerContractBaseProperties', + type: { + name: 'Composite', + class_name: 'AuthorizationServerContractBaseProperties', + model_properties: { + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + authorization_methods: { + required: false, + serialized_name: 'authorizationMethods', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'AuthorizationMethodElementType', + type: { + name: 'Enum', + module: 'AuthorizationMethod' + } + } + } + }, + client_authentication_method: { + required: false, + serialized_name: 'clientAuthenticationMethod', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ClientAuthenticationMethodElementType', + type: { + name: 'String' + } + } + } + }, + token_body_parameters: { + required: false, + serialized_name: 'tokenBodyParameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'TokenBodyParameterContractElementType', + type: { + name: 'Composite', + class_name: 'TokenBodyParameterContract' + } + } + } + }, + token_endpoint: { + required: false, + serialized_name: 'tokenEndpoint', + type: { + name: 'String' + } + }, + support_state: { + required: false, + serialized_name: 'supportState', + type: { + name: 'Boolean' + } + }, + default_scope: { + required: false, + serialized_name: 'defaultScope', + type: { + name: 'String' + } + }, + bearer_token_sending_methods: { + required: false, + serialized_name: 'bearerTokenSendingMethods', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'BearerTokenSendingMethodElementType', + type: { + name: 'String' + } + } + } + }, + client_secret: { + required: false, + serialized_name: 'clientSecret', + type: { + name: 'String' + } + }, + resource_owner_username: { + required: false, + serialized_name: 'resourceOwnerUsername', + type: { + name: 'String' + } + }, + resource_owner_password: { + required: false, + serialized_name: 'resourceOwnerPassword', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_update_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_update_contract.rb new file mode 100644 index 0000000000..e7a97e32c6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/authorization_server_update_contract.rb @@ -0,0 +1,284 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # External OAuth authorization server settings. + # + class AuthorizationServerUpdateContract < Resource + + include MsRestAzure + + # @return [String] Description of the authorization server. Can contain + # HTML formatting tags. + attr_accessor :description + + # @return [Array] HTTP verbs supported by the + # authorization endpoint. GET must be always present. POST is optional. + attr_accessor :authorization_methods + + # @return [Array] Method of authentication + # supported by the token endpoint of this authorization server. Possible + # values are Basic and/or Body. When Body is specified, client + # credentials and other parameters are passed within the request body in + # the application/x-www-form-urlencoded format. + attr_accessor :client_authentication_method + + # @return [Array] Additional parameters + # required by the token endpoint of this authorization server represented + # as an array of JSON objects with name and value string properties, i.e. + # {"name" : "name value", "value": "a value"}. + attr_accessor :token_body_parameters + + # @return [String] OAuth token endpoint. Contains absolute URI to entity + # being referenced. + attr_accessor :token_endpoint + + # @return [Boolean] If true, authorization server will include state + # parameter from the authorization request to its response. Client may + # use state parameter to raise protocol security. + attr_accessor :support_state + + # @return [String] Access token scope that is going to be requested by + # default. Can be overridden at the API level. Should be provided in the + # form of a string containing space-delimited values. + attr_accessor :default_scope + + # @return [Array] Specifies the mechanism by + # which access token is passed to the API. + attr_accessor :bearer_token_sending_methods + + # @return [String] Client or app secret registered with this + # authorization server. + attr_accessor :client_secret + + # @return [String] Can be optionally specified when resource owner + # password grant type is supported by this authorization server. Default + # resource owner username. + attr_accessor :resource_owner_username + + # @return [String] Can be optionally specified when resource owner + # password grant type is supported by this authorization server. Default + # resource owner password. + attr_accessor :resource_owner_password + + # @return [String] User-friendly authorization server name. + attr_accessor :display_name + + # @return [String] Optional reference to a page where client or app + # registration for this authorization server is performed. Contains + # absolute URL to entity being referenced. + attr_accessor :client_registration_endpoint + + # @return [String] OAuth authorization endpoint. See + # http://tools.ietf.org/html/rfc6749#section-3.2. + attr_accessor :authorization_endpoint + + # @return [Array] Form of an authorization grant, which the + # client uses to request the access token. + attr_accessor :grant_types + + # @return [String] Client or app id registered with this authorization + # server. + attr_accessor :client_id + + + # + # Mapper for AuthorizationServerUpdateContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AuthorizationServerUpdateContract', + type: { + name: 'Composite', + class_name: 'AuthorizationServerUpdateContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + authorization_methods: { + required: false, + serialized_name: 'properties.authorizationMethods', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'AuthorizationMethodElementType', + type: { + name: 'Enum', + module: 'AuthorizationMethod' + } + } + } + }, + client_authentication_method: { + required: false, + serialized_name: 'properties.clientAuthenticationMethod', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ClientAuthenticationMethodElementType', + type: { + name: 'String' + } + } + } + }, + token_body_parameters: { + required: false, + serialized_name: 'properties.tokenBodyParameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'TokenBodyParameterContractElementType', + type: { + name: 'Composite', + class_name: 'TokenBodyParameterContract' + } + } + } + }, + token_endpoint: { + required: false, + serialized_name: 'properties.tokenEndpoint', + type: { + name: 'String' + } + }, + support_state: { + required: false, + serialized_name: 'properties.supportState', + type: { + name: 'Boolean' + } + }, + default_scope: { + required: false, + serialized_name: 'properties.defaultScope', + type: { + name: 'String' + } + }, + bearer_token_sending_methods: { + required: false, + serialized_name: 'properties.bearerTokenSendingMethods', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'BearerTokenSendingMethodElementType', + type: { + name: 'String' + } + } + } + }, + client_secret: { + required: false, + serialized_name: 'properties.clientSecret', + type: { + name: 'String' + } + }, + resource_owner_username: { + required: false, + serialized_name: 'properties.resourceOwnerUsername', + type: { + name: 'String' + } + }, + resource_owner_password: { + required: false, + serialized_name: 'properties.resourceOwnerPassword', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 50, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + client_registration_endpoint: { + required: false, + serialized_name: 'properties.clientRegistrationEndpoint', + type: { + name: 'String' + } + }, + authorization_endpoint: { + required: false, + serialized_name: 'properties.authorizationEndpoint', + type: { + name: 'String' + } + }, + grant_types: { + required: false, + serialized_name: 'properties.grantTypes', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'GrantTypeElementType', + type: { + name: 'String' + } + } + } + }, + client_id: { + required: false, + serialized_name: 'properties.clientId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_authorization_header_credentials.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_authorization_header_credentials.rb new file mode 100644 index 0000000000..84bd440cc2 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_authorization_header_credentials.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Authorization header information. + # + class BackendAuthorizationHeaderCredentials + + include MsRestAzure + + # @return [String] Authentication Scheme name. + attr_accessor :scheme + + # @return [String] Authentication Parameter value. + attr_accessor :parameter + + + # + # Mapper for BackendAuthorizationHeaderCredentials class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendAuthorizationHeaderCredentials', + type: { + name: 'Composite', + class_name: 'BackendAuthorizationHeaderCredentials', + model_properties: { + scheme: { + required: true, + serialized_name: 'scheme', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + parameter: { + required: true, + serialized_name: 'parameter', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_base_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_base_parameters.rb new file mode 100644 index 0000000000..edcf5d1b65 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_base_parameters.rb @@ -0,0 +1,123 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Backend entity base Parameter set. + # + class BackendBaseParameters + + include MsRestAzure + + # @return [String] Backend Title. + attr_accessor :title + + # @return [String] Backend Description. + attr_accessor :description + + # @return [String] Management Uri of the Resource in External System. + # This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + # Apps. + attr_accessor :resource_id + + # @return [BackendProperties] Backend Properties contract + attr_accessor :properties + + # @return [BackendCredentialsContract] Backend Credentials Contract + # Properties + attr_accessor :credentials + + # @return [BackendProxyContract] Backend Proxy Contract Properties + attr_accessor :proxy + + # @return [BackendTlsProperties] Backend TLS Properties + attr_accessor :tls + + + # + # Mapper for BackendBaseParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendBaseParameters', + type: { + name: 'Composite', + class_name: 'BackendBaseParameters', + model_properties: { + title: { + required: false, + serialized_name: 'title', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + resource_id: { + required: false, + serialized_name: 'resourceId', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + properties: { + required: false, + serialized_name: 'properties', + type: { + name: 'Composite', + class_name: 'BackendProperties' + } + }, + credentials: { + required: false, + serialized_name: 'credentials', + type: { + name: 'Composite', + class_name: 'BackendCredentialsContract' + } + }, + proxy: { + required: false, + serialized_name: 'proxy', + type: { + name: 'Composite', + class_name: 'BackendProxyContract' + } + }, + tls: { + required: false, + serialized_name: 'tls', + type: { + name: 'Composite', + class_name: 'BackendTlsProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_collection.rb new file mode 100644 index 0000000000..8956681ac1 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Backend list representation. + # + class BackendCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Backend values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [BackendCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for BackendCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendCollection', + type: { + name: 'Composite', + class_name: 'BackendCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'BackendContractElementType', + type: { + name: 'Composite', + class_name: 'BackendContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_contract.rb new file mode 100644 index 0000000000..fdc2656897 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_contract.rb @@ -0,0 +1,172 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Backend details. + # + class BackendContract < Resource + + include MsRestAzure + + # @return [String] Backend Title. + attr_accessor :title + + # @return [String] Backend Description. + attr_accessor :description + + # @return [String] Management Uri of the Resource in External System. + # This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + # Apps. + attr_accessor :resource_id + + # @return [BackendProperties] Backend Properties contract + attr_accessor :properties + + # @return [BackendCredentialsContract] Backend Credentials Contract + # Properties + attr_accessor :credentials + + # @return [BackendProxyContract] Backend Proxy Contract Properties + attr_accessor :proxy + + # @return [BackendTlsProperties] Backend TLS Properties + attr_accessor :tls + + # @return [String] Runtime Url of the Backend. + attr_accessor :url + + # @return [BackendProtocol] Backend communication protocol. Possible + # values include: 'http', 'soap' + attr_accessor :protocol + + + # + # Mapper for BackendContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendContract', + type: { + name: 'Composite', + class_name: 'BackendContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + title: { + required: false, + serialized_name: 'properties.title', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + resource_id: { + required: false, + serialized_name: 'properties.resourceId', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + properties: { + required: false, + serialized_name: 'properties.properties', + type: { + name: 'Composite', + class_name: 'BackendProperties' + } + }, + credentials: { + required: false, + serialized_name: 'properties.credentials', + type: { + name: 'Composite', + class_name: 'BackendCredentialsContract' + } + }, + proxy: { + required: false, + serialized_name: 'properties.proxy', + type: { + name: 'Composite', + class_name: 'BackendProxyContract' + } + }, + tls: { + required: false, + serialized_name: 'properties.tls', + type: { + name: 'Composite', + class_name: 'BackendTlsProperties' + } + }, + url: { + required: true, + serialized_name: 'properties.url', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + protocol: { + required: true, + serialized_name: 'properties.protocol', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_credentials_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_credentials_contract.rb new file mode 100644 index 0000000000..4e96e1f9c7 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_credentials_contract.rb @@ -0,0 +1,114 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Details of the Credentials used to connect to Backend. + # + class BackendCredentialsContract + + include MsRestAzure + + # @return [Array] List of Client Certificate Thumbprint. + attr_accessor :certificate + + # @return [Hash{String => Array}] Query Parameter description. + attr_accessor :query + + # @return [Hash{String => Array}] Header Parameter description. + attr_accessor :header + + # @return [BackendAuthorizationHeaderCredentials] Authorization header + # authentication + attr_accessor :authorization + + + # + # Mapper for BackendCredentialsContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendCredentialsContract', + type: { + name: 'Composite', + class_name: 'BackendCredentialsContract', + model_properties: { + certificate: { + required: false, + serialized_name: 'certificate', + constraints: { + MaxItems: 32 + }, + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + query: { + required: false, + serialized_name: 'query', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + }, + header: { + required: false, + serialized_name: 'header', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + }, + authorization: { + required: false, + serialized_name: 'authorization', + type: { + name: 'Composite', + class_name: 'BackendAuthorizationHeaderCredentials' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_properties.rb new file mode 100644 index 0000000000..10df6c043f --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_properties.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Properties specific to the Backend Type. + # + class BackendProperties + + include MsRestAzure + + # @return [BackendServiceFabricClusterProperties] Backend Service Fabric + # Cluster Properties + attr_accessor :service_fabric_cluster + + + # + # Mapper for BackendProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendProperties', + type: { + name: 'Composite', + class_name: 'BackendProperties', + model_properties: { + service_fabric_cluster: { + required: false, + serialized_name: 'serviceFabricCluster', + type: { + name: 'Composite', + class_name: 'BackendServiceFabricClusterProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_protocol.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_protocol.rb new file mode 100644 index 0000000000..1da99a6838 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for BackendProtocol + # + module BackendProtocol + Http = "http" + Soap = "soap" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_proxy_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_proxy_contract.rb new file mode 100644 index 0000000000..d15bee24a1 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_proxy_contract.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Details of the Backend WebProxy Server to use in the Request to Backend. + # + class BackendProxyContract + + include MsRestAzure + + # @return [String] WebProxy Server AbsoluteUri property which includes + # the entire URI stored in the Uri instance, including all fragments and + # query strings. + attr_accessor :url + + # @return [String] Username to connect to the WebProxy server + attr_accessor :username + + # @return [String] Password to connect to the WebProxy Server + attr_accessor :password + + + # + # Mapper for BackendProxyContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendProxyContract', + type: { + name: 'Composite', + class_name: 'BackendProxyContract', + model_properties: { + url: { + required: true, + serialized_name: 'url', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + username: { + required: false, + serialized_name: 'username', + type: { + name: 'String' + } + }, + password: { + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_reconnect_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_reconnect_contract.rb new file mode 100644 index 0000000000..5e513038e4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_reconnect_contract.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Reconnect request parameters. + # + class BackendReconnectContract < Resource + + include MsRestAzure + + # @return [Duration] Duration in ISO8601 format after which reconnect + # will be initiated. Minimum duration of the Reconect is PT2M. + attr_accessor :after + + + # + # Mapper for BackendReconnectContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendReconnectContract', + type: { + name: 'Composite', + class_name: 'BackendReconnectContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + after: { + required: false, + serialized_name: 'properties.after', + type: { + name: 'TimeSpan' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_service_fabric_cluster_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_service_fabric_cluster_properties.rb new file mode 100644 index 0000000000..e171bbe81c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_service_fabric_cluster_properties.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Properties of the Service Fabric Type Backend. + # + class BackendServiceFabricClusterProperties + + include MsRestAzure + + # @return [String] The client certificate thumbprint for the management + # endpoint. + attr_accessor :client_certificatethumbprint + + # @return [Integer] Maximum number of retries while attempting resolve + # the parition. + attr_accessor :max_partition_resolution_retries + + # @return [Array] The cluster management endpoint. + attr_accessor :management_endpoints + + # @return [Array] Thumbprints of certificates cluster management + # service uses for tls communication + attr_accessor :server_certificate_thumbprints + + # @return [Array] Server X509 Certificate Names + # Collection + attr_accessor :server_x509names + + + # + # Mapper for BackendServiceFabricClusterProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendServiceFabricClusterProperties', + type: { + name: 'Composite', + class_name: 'BackendServiceFabricClusterProperties', + model_properties: { + client_certificatethumbprint: { + required: true, + serialized_name: 'clientCertificatethumbprint', + type: { + name: 'String' + } + }, + max_partition_resolution_retries: { + required: false, + serialized_name: 'maxPartitionResolutionRetries', + type: { + name: 'Number' + } + }, + management_endpoints: { + required: true, + serialized_name: 'managementEndpoints', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + server_certificate_thumbprints: { + required: false, + serialized_name: 'serverCertificateThumbprints', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + server_x509names: { + required: false, + serialized_name: 'serverX509Names', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'X509CertificateNameElementType', + type: { + name: 'Composite', + class_name: 'X509CertificateName' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_tls_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_tls_properties.rb new file mode 100644 index 0000000000..be62d2b753 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_tls_properties.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Properties controlling TLS Certificate Validation. + # + class BackendTlsProperties + + include MsRestAzure + + # @return [Boolean] Flag indicating whether SSL certificate chain + # validation should be done when using self-signed certificates for this + # backend host. Default value: true . + attr_accessor :validate_certificate_chain + + # @return [Boolean] Flag indicating whether SSL certificate name + # validation should be done when using self-signed certificates for this + # backend host. Default value: true . + attr_accessor :validate_certificate_name + + + # + # Mapper for BackendTlsProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendTlsProperties', + type: { + name: 'Composite', + class_name: 'BackendTlsProperties', + model_properties: { + validate_certificate_chain: { + required: false, + serialized_name: 'validateCertificateChain', + default_value: true, + type: { + name: 'Boolean' + } + }, + validate_certificate_name: { + required: false, + serialized_name: 'validateCertificateName', + default_value: true, + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_update_parameters.rb new file mode 100644 index 0000000000..e871509a3c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/backend_update_parameters.rb @@ -0,0 +1,148 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Backend update parameters. + # + class BackendUpdateParameters + + include MsRestAzure + + # @return [String] Backend Title. + attr_accessor :title + + # @return [String] Backend Description. + attr_accessor :description + + # @return [String] Management Uri of the Resource in External System. + # This url can be the Arm Resource Id of Logic Apps, Function Apps or Api + # Apps. + attr_accessor :resource_id + + # @return [BackendProperties] Backend Properties contract + attr_accessor :properties + + # @return [BackendCredentialsContract] Backend Credentials Contract + # Properties + attr_accessor :credentials + + # @return [BackendProxyContract] Backend Proxy Contract Properties + attr_accessor :proxy + + # @return [BackendTlsProperties] Backend TLS Properties + attr_accessor :tls + + # @return [String] Runtime Url of the Backend. + attr_accessor :url + + # @return [BackendProtocol] Backend communication protocol. Possible + # values include: 'http', 'soap' + attr_accessor :protocol + + + # + # Mapper for BackendUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BackendUpdateParameters', + type: { + name: 'Composite', + class_name: 'BackendUpdateParameters', + model_properties: { + title: { + required: false, + serialized_name: 'properties.title', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + resource_id: { + required: false, + serialized_name: 'properties.resourceId', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + properties: { + required: false, + serialized_name: 'properties.properties', + type: { + name: 'Composite', + class_name: 'BackendProperties' + } + }, + credentials: { + required: false, + serialized_name: 'properties.credentials', + type: { + name: 'Composite', + class_name: 'BackendCredentialsContract' + } + }, + proxy: { + required: false, + serialized_name: 'properties.proxy', + type: { + name: 'Composite', + class_name: 'BackendProxyContract' + } + }, + tls: { + required: false, + serialized_name: 'properties.tls', + type: { + name: 'Composite', + class_name: 'BackendTlsProperties' + } + }, + url: { + required: false, + serialized_name: 'properties.url', + constraints: { + MaxLength: 2000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + protocol: { + required: false, + serialized_name: 'properties.protocol', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/bearer_token_sending_method.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/bearer_token_sending_method.rb new file mode 100644 index 0000000000..9c2101067b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/bearer_token_sending_method.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for BearerTokenSendingMethod + # + module BearerTokenSendingMethod + AuthorizationHeader = "authorizationHeader" + Query = "query" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_collection.rb new file mode 100644 index 0000000000..15defeec9f --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Certificates list representation. + # + class CertificateCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [CertificateCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for CertificateCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'CertificateCollection', + type: { + name: 'Composite', + class_name: 'CertificateCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'CertificateContractElementType', + type: { + name: 'Composite', + class_name: 'CertificateContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_configuration.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_configuration.rb new file mode 100644 index 0000000000..e330d42ce8 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_configuration.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Certificate configuration which consist of non-trusted intermediates and + # root certificates. + # + class CertificateConfiguration + + include MsRestAzure + + # @return [String] Base64 Encoded certificate. + attr_accessor :encoded_certificate + + # @return [String] Certificate Password. + attr_accessor :certificate_password + + # @return [Enum] The + # System.Security.Cryptography.x509certificates.Storename certificate + # store location. Only Root and CertificateAuthority are valid locations. + # Possible values include: 'CertificateAuthority', 'Root' + attr_accessor :store_name + + # @return [CertificateInformation] Certificate information. + attr_accessor :certificate + + + # + # Mapper for CertificateConfiguration class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'CertificateConfiguration', + type: { + name: 'Composite', + class_name: 'CertificateConfiguration', + model_properties: { + encoded_certificate: { + required: false, + serialized_name: 'encodedCertificate', + type: { + name: 'String' + } + }, + certificate_password: { + required: false, + serialized_name: 'certificatePassword', + type: { + name: 'String' + } + }, + store_name: { + required: true, + serialized_name: 'storeName', + type: { + name: 'String' + } + }, + certificate: { + required: false, + read_only: true, + serialized_name: 'certificate', + type: { + name: 'Composite', + class_name: 'CertificateInformation' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_contract.rb new file mode 100644 index 0000000000..666e0c68a4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_contract.rb @@ -0,0 +1,91 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Certificate details. + # + class CertificateContract < Resource + + include MsRestAzure + + # @return [String] Subject attribute of the certificate. + attr_accessor :subject + + # @return [String] Thumbprint of the certificate. + attr_accessor :thumbprint + + # @return [DateTime] Expiration date of the certificate. The date + # conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + # by the ISO 8601 standard. + # + attr_accessor :expiration_date + + + # + # Mapper for CertificateContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'CertificateContract', + type: { + name: 'Composite', + class_name: 'CertificateContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + subject: { + required: true, + serialized_name: 'properties.subject', + type: { + name: 'String' + } + }, + thumbprint: { + required: true, + serialized_name: 'properties.thumbprint', + type: { + name: 'String' + } + }, + expiration_date: { + required: true, + serialized_name: 'properties.expirationDate', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb new file mode 100644 index 0000000000..f51b20c3e5 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_create_or_update_parameters.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Certificate create or update details. + # + class CertificateCreateOrUpdateParameters + + include MsRestAzure + + # @return [String] Base 64 encoded certificate using the + # application/x-pkcs12 representation. + attr_accessor :data + + # @return [String] Password for the Certificate + attr_accessor :password + + + # + # Mapper for CertificateCreateOrUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'CertificateCreateOrUpdateParameters', + type: { + name: 'Composite', + class_name: 'CertificateCreateOrUpdateParameters', + model_properties: { + data: { + required: true, + serialized_name: 'properties.data', + type: { + name: 'String' + } + }, + password: { + required: true, + serialized_name: 'properties.password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_information.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_information.rb new file mode 100644 index 0000000000..939ec4176d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/certificate_information.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # SSL certificate information. + # + class CertificateInformation + + include MsRestAzure + + # @return [DateTime] Expiration date of the certificate. The date + # conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + # by the ISO 8601 standard. + attr_accessor :expiry + + # @return [String] Thumbprint of the certificate. + attr_accessor :thumbprint + + # @return [String] Subject of the certificate. + attr_accessor :subject + + + # + # Mapper for CertificateInformation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'CertificateInformation', + type: { + name: 'Composite', + class_name: 'CertificateInformation', + model_properties: { + expiry: { + required: true, + serialized_name: 'expiry', + type: { + name: 'DateTime' + } + }, + thumbprint: { + required: true, + serialized_name: 'thumbprint', + type: { + name: 'String' + } + }, + subject: { + required: true, + serialized_name: 'subject', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/client_authentication_method.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/client_authentication_method.rb new file mode 100644 index 0000000000..52679997c5 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/client_authentication_method.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for ClientAuthenticationMethod + # + module ClientAuthenticationMethod + Basic = "Basic" + Body = "Body" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/confirmation.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/confirmation.rb new file mode 100644 index 0000000000..a741634c5d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/confirmation.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for Confirmation + # + module Confirmation + Signup = "signup" + Invite = "invite" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/connectivity_status_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/connectivity_status_contract.rb new file mode 100644 index 0000000000..b5a4c62320 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/connectivity_status_contract.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Details about connectivity to a resource. + # + class ConnectivityStatusContract + + include MsRestAzure + + # @return [String] The hostname of the resource which the service depends + # on. This can be the database, storage or any other azure resource on + # which the service depends upon. + attr_accessor :name + + # @return [ConnectivityStatusType] Resource Connectivity Status Type + # identifier. Possible values include: 'initializing', 'success', + # 'failure' + attr_accessor :status + + # @return [String] Error details of the connectivity to the resource. + attr_accessor :error + + # @return [DateTime] The date when the resource connectivity status was + # last updated. This status should be updated every 15 minutes. If this + # status has not been updated, then it means that the service has lost + # network connectivity to the resource, from inside the Virtual + # Network.The date conforms to the following format: + # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + # + attr_accessor :last_updated + + # @return [DateTime] The date when the resource connectivity status last + # Changed from success to failure or vice-versa. The date conforms to the + # following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + # standard. + # + attr_accessor :last_status_change + + + # + # Mapper for ConnectivityStatusContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ConnectivityStatusContract', + type: { + name: 'Composite', + class_name: 'ConnectivityStatusContract', + model_properties: { + name: { + required: true, + serialized_name: 'name', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + status: { + required: true, + serialized_name: 'status', + type: { + name: 'String' + } + }, + error: { + required: false, + serialized_name: 'error', + type: { + name: 'String' + } + }, + last_updated: { + required: true, + serialized_name: 'lastUpdated', + type: { + name: 'DateTime' + } + }, + last_status_change: { + required: true, + serialized_name: 'lastStatusChange', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/connectivity_status_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/connectivity_status_type.rb new file mode 100644 index 0000000000..4d3da3590a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/connectivity_status_type.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for ConnectivityStatusType + # + module ConnectivityStatusType + Initializing = "initializing" + Success = "success" + Failure = "failure" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/content_format.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/content_format.rb new file mode 100644 index 0000000000..e58448e375 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/content_format.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for ContentFormat + # + module ContentFormat + WadlXml = "wadl-xml" + WadlLinkJson = "wadl-link-json" + SwaggerJson = "swagger-json" + SwaggerLinkJson = "swagger-link-json" + Wsdl = "wsdl" + WsdlLink = "wsdl-link" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb new file mode 100644 index 0000000000..06504b5594 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/deploy_configuration_parameters.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Deploy Configuration operation. + # + class DeployConfigurationParameters + + include MsRestAzure + + # @return [String] The name of the Git branch from which the + # configuration is to be deployed to the configuration database. + attr_accessor :branch + + # @return [Boolean] The value enforcing deleting subscriptions to + # products that are deleted in this update. + attr_accessor :force + + + # + # Mapper for DeployConfigurationParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DeployConfigurationParameters', + type: { + name: 'Composite', + class_name: 'DeployConfigurationParameters', + model_properties: { + branch: { + required: true, + serialized_name: 'branch', + type: { + name: 'String' + } + }, + force: { + required: false, + serialized_name: 'force', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/diagnostic_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/diagnostic_collection.rb new file mode 100644 index 0000000000..0c09eec787 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/diagnostic_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Diagnostic list representation. + # + class DiagnosticCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [DiagnosticCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for DiagnosticCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DiagnosticCollection', + type: { + name: 'Composite', + class_name: 'DiagnosticCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'DiagnosticContractElementType', + type: { + name: 'Composite', + class_name: 'DiagnosticContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/diagnostic_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/diagnostic_contract.rb new file mode 100644 index 0000000000..6f0ada800d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/diagnostic_contract.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Diagnostic details. + # + class DiagnosticContract < Resource + + include MsRestAzure + + # @return [Boolean] Indicates whether a diagnostic should receive data or + # not. + attr_accessor :enabled + + + # + # Mapper for DiagnosticContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DiagnosticContract', + type: { + name: 'Composite', + class_name: 'DiagnosticContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + enabled: { + required: true, + serialized_name: 'properties.enabled', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_collection.rb new file mode 100644 index 0000000000..f190f2ff72 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged email template list representation. + # + class EmailTemplateCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [EmailTemplateCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for EmailTemplateCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EmailTemplateCollection', + type: { + name: 'Composite', + class_name: 'EmailTemplateCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EmailTemplateContractElementType', + type: { + name: 'Composite', + class_name: 'EmailTemplateContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_contract.rb new file mode 100644 index 0000000000..e17258edbb --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_contract.rb @@ -0,0 +1,136 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Email Template details. + # + class EmailTemplateContract < Resource + + include MsRestAzure + + # @return [String] Subject of the Template. + attr_accessor :subject + + # @return [String] Email Template Body. This should be a valid XDocument + attr_accessor :body + + # @return [String] Title of the Template. + attr_accessor :title + + # @return [String] Description of the Email Template. + attr_accessor :description + + # @return [Boolean] Whether the template is the default template provided + # by Api Management or has been edited. + attr_accessor :is_default + + # @return [Array] Email + # Template Parameter values. + attr_accessor :parameters + + + # + # Mapper for EmailTemplateContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EmailTemplateContract', + type: { + name: 'Composite', + class_name: 'EmailTemplateContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + subject: { + required: true, + serialized_name: 'properties.subject', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + body: { + required: true, + serialized_name: 'properties.body', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + title: { + required: false, + serialized_name: 'properties.title', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + is_default: { + required: false, + read_only: true, + serialized_name: 'properties.isDefault', + type: { + name: 'Boolean' + } + }, + parameters: { + required: false, + serialized_name: 'properties.parameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EmailTemplateParametersContractPropertiesElementType', + type: { + name: 'Composite', + class_name: 'EmailTemplateParametersContractProperties' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_parameters_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_parameters_contract_properties.rb new file mode 100644 index 0000000000..23b4541660 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_parameters_contract_properties.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Email Template Parameter contract. + # + class EmailTemplateParametersContractProperties + + include MsRestAzure + + # @return [String] Template parameter name. + attr_accessor :name + + # @return [String] Template parameter title. + attr_accessor :title + + # @return [String] Template parameter description. + attr_accessor :description + + + # + # Mapper for EmailTemplateParametersContractProperties class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EmailTemplateParametersContractProperties', + type: { + name: 'Composite', + class_name: 'EmailTemplateParametersContractProperties', + model_properties: { + name: { + required: false, + serialized_name: 'name', + constraints: { + MaxLength: 256, + MinLength: 1, + Pattern: '^[A-Za-z0-9-._]+$' + }, + type: { + name: 'String' + } + }, + title: { + required: false, + serialized_name: 'title', + constraints: { + MaxLength: 4096, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + constraints: { + MaxLength: 256, + MinLength: 1, + Pattern: '^[A-Za-z0-9-._]+$' + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_update_parameters.rb new file mode 100644 index 0000000000..2ab613df9a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/email_template_update_parameters.rb @@ -0,0 +1,100 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Email Template update Parameters. + # + class EmailTemplateUpdateParameters + + include MsRestAzure + + # @return [String] Subject of the Template. + attr_accessor :subject + + # @return [String] Title of the Template. + attr_accessor :title + + # @return [String] Description of the Email Template. + attr_accessor :description + + # @return [String] Email Template Body. This should be a valid XDocument + attr_accessor :body + + # @return [Array] Email + # Template Parameter values. + attr_accessor :parameters + + + # + # Mapper for EmailTemplateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EmailTemplateUpdateParameters', + type: { + name: 'Composite', + class_name: 'EmailTemplateUpdateParameters', + model_properties: { + subject: { + required: false, + serialized_name: 'properties.subject', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + title: { + required: false, + serialized_name: 'properties.title', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + body: { + required: false, + serialized_name: 'properties.body', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + parameters: { + required: false, + serialized_name: 'properties.parameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EmailTemplateParametersContractPropertiesElementType', + type: { + name: 'Composite', + class_name: 'EmailTemplateParametersContractProperties' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/error_field_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/error_field_contract.rb new file mode 100644 index 0000000000..d63aedd531 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/error_field_contract.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Error Field contract. + # + class ErrorFieldContract + + include MsRestAzure + + # @return [String] Property level error code. + attr_accessor :code + + # @return [String] Human-readable representation of property-level error. + attr_accessor :message + + # @return [String] Property name. + attr_accessor :target + + + # + # Mapper for ErrorFieldContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ErrorFieldContract', + type: { + name: 'Composite', + class_name: 'ErrorFieldContract', + model_properties: { + code: { + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + }, + target: { + required: false, + serialized_name: 'target', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/error_response.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/error_response.rb new file mode 100644 index 0000000000..9bd68b2734 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/error_response.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Error Response. + # + class ErrorResponse + + include MsRestAzure + + # @return [String] Service-defined error code. This code serves as a + # sub-status for the HTTP error code specified in the response. + attr_accessor :code + + # @return [String] Human-readable representation of the error. + attr_accessor :message + + # @return [Array] The list of invalid fields send in + # request, in case of validation error. + attr_accessor :details + + + # + # Mapper for ErrorResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ErrorResponse', + type: { + name: 'Composite', + class_name: 'ErrorResponse', + model_properties: { + code: { + required: false, + serialized_name: 'error.code', + type: { + name: 'String' + } + }, + message: { + required: false, + serialized_name: 'error.message', + type: { + name: 'String' + } + }, + details: { + required: false, + serialized_name: 'error.details', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ErrorFieldContractElementType', + type: { + name: 'Composite', + class_name: 'ErrorFieldContract' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/export_format.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/export_format.rb new file mode 100644 index 0000000000..6cb51c0f22 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/export_format.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for ExportFormat + # + module ExportFormat + Swagger = "swagger-link" + Wsdl = "wsdl-link" + Wadl = "wadl-link" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb new file mode 100644 index 0000000000..773bb4fac7 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/generate_sso_url_result.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Generate SSO Url operations response details. + # + class GenerateSsoUrlResult + + include MsRestAzure + + # @return [String] Redirect Url containing the SSO URL value. + attr_accessor :value + + + # + # Mapper for GenerateSsoUrlResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GenerateSsoUrlResult', + type: { + name: 'Composite', + class_name: 'GenerateSsoUrlResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/grant_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/grant_type.rb new file mode 100644 index 0000000000..f722726a42 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/grant_type.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for GrantType + # + module GrantType + AuthorizationCode = "authorizationCode" + Implicit = "implicit" + ResourceOwnerPassword = "resourceOwnerPassword" + ClientCredentials = "clientCredentials" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_collection.rb new file mode 100644 index 0000000000..deaa6a7f34 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Group list representation. + # + class GroupCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [GroupCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for GroupCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GroupCollection', + type: { + name: 'Composite', + class_name: 'GroupCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'GroupContractElementType', + type: { + name: 'Composite', + class_name: 'GroupContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_contract.rb new file mode 100644 index 0000000000..8544f4ec1c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_contract.rb @@ -0,0 +1,122 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Contract details. + # + class GroupContract < Resource + + include MsRestAzure + + # @return [String] Group name. + attr_accessor :display_name + + # @return [String] Group description. Can contain HTML formatting tags. + attr_accessor :description + + # @return [Boolean] true if the group is one of the three system groups + # (Administrators, Developers, or Guests); otherwise false. + attr_accessor :built_in + + # @return [GroupType] Group type. Possible values include: 'custom', + # 'system', 'external' + attr_accessor :group_contract_type + + # @return [String] For external groups, this property contains the id of + # the group from the external identity provider, e.g. for Azure Active + # Directory aad://.onmicrosoft.com/groups/; + # otherwise the value is null. + attr_accessor :external_id + + + # + # Mapper for GroupContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GroupContract', + type: { + name: 'Composite', + class_name: 'GroupContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + constraints: { + MaxLength: 1000 + }, + type: { + name: 'String' + } + }, + built_in: { + required: false, + read_only: true, + serialized_name: 'properties.builtIn', + type: { + name: 'Boolean' + } + }, + group_contract_type: { + required: false, + serialized_name: 'properties.type', + type: { + name: 'Enum', + module: 'GroupType' + } + }, + external_id: { + required: false, + serialized_name: 'properties.externalId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_contract_properties.rb new file mode 100644 index 0000000000..90bb57c014 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_contract_properties.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Group contract Properties. + # + class GroupContractProperties + + include MsRestAzure + + # @return [String] Group name. + attr_accessor :display_name + + # @return [String] Group description. Can contain HTML formatting tags. + attr_accessor :description + + # @return [Boolean] true if the group is one of the three system groups + # (Administrators, Developers, or Guests); otherwise false. + attr_accessor :built_in + + # @return [GroupType] Group type. Possible values include: 'custom', + # 'system', 'external' + attr_accessor :type + + # @return [String] For external groups, this property contains the id of + # the group from the external identity provider, e.g. for Azure Active + # Directory aad://.onmicrosoft.com/groups/; + # otherwise the value is null. + attr_accessor :external_id + + + # + # Mapper for GroupContractProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GroupContractProperties', + type: { + name: 'Composite', + class_name: 'GroupContractProperties', + model_properties: { + display_name: { + required: true, + serialized_name: 'displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + constraints: { + MaxLength: 1000 + }, + type: { + name: 'String' + } + }, + built_in: { + required: false, + read_only: true, + serialized_name: 'builtIn', + type: { + name: 'Boolean' + } + }, + type: { + required: false, + serialized_name: 'type', + type: { + name: 'Enum', + module: 'GroupType' + } + }, + external_id: { + required: false, + serialized_name: 'externalId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_create_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_create_parameters.rb new file mode 100644 index 0000000000..b42a617d3d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_create_parameters.rb @@ -0,0 +1,83 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Create Group operation. + # + class GroupCreateParameters + + include MsRestAzure + + # @return [String] Group name. + attr_accessor :display_name + + # @return [String] Group description. + attr_accessor :description + + # @return [GroupType] Group type. Possible values include: 'custom', + # 'system', 'external' + attr_accessor :type + + # @return [String] Identifier of the external groups, this property + # contains the id of the group from the external identity provider, e.g. + # for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + attr_accessor :external_id + + + # + # Mapper for GroupCreateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GroupCreateParameters', + type: { + name: 'Composite', + class_name: 'GroupCreateParameters', + model_properties: { + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + type: { + required: false, + serialized_name: 'properties.type', + type: { + name: 'Enum', + module: 'GroupType' + } + }, + external_id: { + required: false, + serialized_name: 'properties.externalId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_type.rb new file mode 100644 index 0000000000..6324409ecb --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_type.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for GroupType + # + module GroupType + Custom = "custom" + System = "system" + External = "external" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_update_parameters.rb new file mode 100644 index 0000000000..ac5eb974c6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/group_update_parameters.rb @@ -0,0 +1,83 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Update Group operation. + # + class GroupUpdateParameters + + include MsRestAzure + + # @return [String] Group name. + attr_accessor :display_name + + # @return [String] Group description. + attr_accessor :description + + # @return [GroupType] Group type. Possible values include: 'custom', + # 'system', 'external' + attr_accessor :type + + # @return [String] Identifier of the external groups, this property + # contains the id of the group from the external identity provider, e.g. + # for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + attr_accessor :external_id + + + # + # Mapper for GroupUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GroupUpdateParameters', + type: { + name: 'Composite', + class_name: 'GroupUpdateParameters', + model_properties: { + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + type: { + required: false, + serialized_name: 'properties.type', + type: { + name: 'Enum', + module: 'GroupType' + } + }, + external_id: { + required: false, + serialized_name: 'properties.externalId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_configuration.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_configuration.rb new file mode 100644 index 0000000000..2f1cc8e18e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_configuration.rb @@ -0,0 +1,130 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Custom hostname configuration. + # + class HostnameConfiguration + + include MsRestAzure + + # @return [HostnameType] Hostname type. Possible values include: 'Proxy', + # 'Portal', 'Management', 'Scm' + attr_accessor :type + + # @return [String] Hostname to configure on the Api Management service. + attr_accessor :host_name + + # @return [String] Url to the KeyVault Secret containing the Ssl + # Certificate. If absolute Url containing version is provided, + # auto-update of ssl certificate will not work. This requires Api + # Management service to be configured with MSI. The secret should be of + # type *application/x-pkcs12* + attr_accessor :key_vault_id + + # @return [String] Base64 Encoded certificate. + attr_accessor :encoded_certificate + + # @return [String] Certificate Password. + attr_accessor :certificate_password + + # @return [Boolean] Specify true to setup the certificate associated with + # this Hostname as the Default SSL Certificate. If a client does not send + # the SNI header, then this will be the certificate that will be + # challenged. The property is useful if a service has multiple custom + # hostname enabled and it needs to decide on the default ssl certificate. + # The setting only applied to Proxy Hostname Type. Default value: false . + attr_accessor :default_ssl_binding + + # @return [Boolean] Specify true to always negotiate client certificate + # on the hostname. Default Value is false. Default value: false . + attr_accessor :negotiate_client_certificate + + # @return [CertificateInformation] Certificate information. + attr_accessor :certificate + + + # + # Mapper for HostnameConfiguration class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'HostnameConfiguration', + type: { + name: 'Composite', + class_name: 'HostnameConfiguration', + model_properties: { + type: { + required: true, + serialized_name: 'type', + type: { + name: 'Enum', + module: 'HostnameType' + } + }, + host_name: { + required: true, + serialized_name: 'hostName', + type: { + name: 'String' + } + }, + key_vault_id: { + required: false, + serialized_name: 'keyVaultId', + type: { + name: 'String' + } + }, + encoded_certificate: { + required: false, + serialized_name: 'encodedCertificate', + type: { + name: 'String' + } + }, + certificate_password: { + required: false, + serialized_name: 'certificatePassword', + type: { + name: 'String' + } + }, + default_ssl_binding: { + required: false, + serialized_name: 'defaultSslBinding', + default_value: false, + type: { + name: 'Boolean' + } + }, + negotiate_client_certificate: { + required: false, + serialized_name: 'negotiateClientCertificate', + default_value: false, + type: { + name: 'Boolean' + } + }, + certificate: { + required: false, + read_only: true, + serialized_name: 'certificate', + type: { + name: 'Composite', + class_name: 'CertificateInformation' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_configuration_old.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_configuration_old.rb new file mode 100644 index 0000000000..ab5077e29f --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_configuration_old.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Custom hostname configuration. + # + class HostnameConfigurationOld + + include MsRestAzure + + # @return [HostnameType] Hostname type. Possible values include: 'Proxy', + # 'Portal', 'Management', 'Scm' + attr_accessor :type + + # @return [String] Hostname to configure. + attr_accessor :hostname + + # @return [CertificateInformation] Certificate information. + attr_accessor :certificate + + + # + # Mapper for HostnameConfigurationOld class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'HostnameConfigurationOld', + type: { + name: 'Composite', + class_name: 'HostnameConfigurationOld', + model_properties: { + type: { + required: true, + serialized_name: 'type', + type: { + name: 'Enum', + module: 'HostnameType' + } + }, + hostname: { + required: true, + serialized_name: 'hostname', + type: { + name: 'String' + } + }, + certificate: { + required: true, + serialized_name: 'certificate', + type: { + name: 'Composite', + class_name: 'CertificateInformation' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_type.rb new file mode 100644 index 0000000000..92803a31ce --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/hostname_type.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for HostnameType + # + module HostnameType + Proxy = "Proxy" + Portal = "Portal" + Management = "Management" + Scm = "Scm" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_base_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_base_parameters.rb new file mode 100644 index 0000000000..883d068d9b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_base_parameters.rb @@ -0,0 +1,123 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Identity Provider Base Parameter Properties. + # + class IdentityProviderBaseParameters + + include MsRestAzure + + # @return [IdentityProviderType] Identity Provider Type identifier. + # Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + # 'aad', 'aadB2C' + attr_accessor :type + + # @return [Array] List of Allowed Tenants when configuring Azure + # Active Directory login. + attr_accessor :allowed_tenants + + # @return [String] Signup Policy Name. Only applies to AAD B2C Identity + # Provider. + attr_accessor :signup_policy_name + + # @return [String] Signin Policy Name. Only applies to AAD B2C Identity + # Provider. + attr_accessor :signin_policy_name + + # @return [String] Profile Editing Policy Name. Only applies to AAD B2C + # Identity Provider. + attr_accessor :profile_editing_policy_name + + # @return [String] Password Reset Policy Name. Only applies to AAD B2C + # Identity Provider. + attr_accessor :password_reset_policy_name + + + # + # Mapper for IdentityProviderBaseParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IdentityProviderBaseParameters', + type: { + name: 'Composite', + class_name: 'IdentityProviderBaseParameters', + model_properties: { + type: { + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + allowed_tenants: { + required: false, + serialized_name: 'allowedTenants', + constraints: { + MaxItems: 32 + }, + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + signup_policy_name: { + required: false, + serialized_name: 'signupPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + signin_policy_name: { + required: false, + serialized_name: 'signinPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + profile_editing_policy_name: { + required: false, + serialized_name: 'profileEditingPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + password_reset_policy_name: { + required: false, + serialized_name: 'passwordResetPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_contract.rb new file mode 100644 index 0000000000..1a4be45b4e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_contract.rb @@ -0,0 +1,178 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Identity Provider details. + # + class IdentityProviderContract < Resource + + include MsRestAzure + + # @return [IdentityProviderType] Identity Provider Type identifier. + # Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + # 'aad', 'aadB2C' + attr_accessor :identity_provider_contract_type + + # @return [Array] List of Allowed Tenants when configuring Azure + # Active Directory login. + attr_accessor :allowed_tenants + + # @return [String] Signup Policy Name. Only applies to AAD B2C Identity + # Provider. + attr_accessor :signup_policy_name + + # @return [String] Signin Policy Name. Only applies to AAD B2C Identity + # Provider. + attr_accessor :signin_policy_name + + # @return [String] Profile Editing Policy Name. Only applies to AAD B2C + # Identity Provider. + attr_accessor :profile_editing_policy_name + + # @return [String] Password Reset Policy Name. Only applies to AAD B2C + # Identity Provider. + attr_accessor :password_reset_policy_name + + # @return [String] Client Id of the Application in the external Identity + # Provider. It is App ID for Facebook login, Client ID for Google login, + # App ID for Microsoft. + attr_accessor :client_id + + # @return [String] Client secret of the Application in external Identity + # Provider, used to authenticate login request. For example, it is App + # Secret for Facebook login, API Key for Google login, Public Key for + # Microsoft. + attr_accessor :client_secret + + + # + # Mapper for IdentityProviderContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IdentityProviderContract', + type: { + name: 'Composite', + class_name: 'IdentityProviderContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + identity_provider_contract_type: { + required: false, + serialized_name: 'properties.type', + type: { + name: 'String' + } + }, + allowed_tenants: { + required: false, + serialized_name: 'properties.allowedTenants', + constraints: { + MaxItems: 32 + }, + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + signup_policy_name: { + required: false, + serialized_name: 'properties.signupPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + signin_policy_name: { + required: false, + serialized_name: 'properties.signinPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + profile_editing_policy_name: { + required: false, + serialized_name: 'properties.profileEditingPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + password_reset_policy_name: { + required: false, + serialized_name: 'properties.passwordResetPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + client_id: { + required: true, + serialized_name: 'properties.clientId', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + client_secret: { + required: true, + serialized_name: 'properties.clientSecret', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_list.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_list.rb new file mode 100644 index 0000000000..ae535243ab --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_list.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # List of all the Identity Providers configured on the service instance. + # + class IdentityProviderList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Identity Provider + # configuration values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [IdentityProviderList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for IdentityProviderList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IdentityProviderList', + type: { + name: 'Composite', + class_name: 'IdentityProviderList', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'IdentityProviderContractElementType', + type: { + name: 'Composite', + class_name: 'IdentityProviderContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_type.rb new file mode 100644 index 0000000000..4c62183d77 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_type.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for IdentityProviderType + # + module IdentityProviderType + Facebook = "facebook" + Google = "google" + Microsoft = "microsoft" + Twitter = "twitter" + Aad = "aad" + AadB2C = "aadB2C" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb new file mode 100644 index 0000000000..f4673f04c0 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/identity_provider_update_parameters.rb @@ -0,0 +1,154 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to update Identity Provider + # + class IdentityProviderUpdateParameters + + include MsRestAzure + + # @return [IdentityProviderType] Identity Provider Type identifier. + # Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + # 'aad', 'aadB2C' + attr_accessor :type + + # @return [Array] List of Allowed Tenants when configuring Azure + # Active Directory login. + attr_accessor :allowed_tenants + + # @return [String] Signup Policy Name. Only applies to AAD B2C Identity + # Provider. + attr_accessor :signup_policy_name + + # @return [String] Signin Policy Name. Only applies to AAD B2C Identity + # Provider. + attr_accessor :signin_policy_name + + # @return [String] Profile Editing Policy Name. Only applies to AAD B2C + # Identity Provider. + attr_accessor :profile_editing_policy_name + + # @return [String] Password Reset Policy Name. Only applies to AAD B2C + # Identity Provider. + attr_accessor :password_reset_policy_name + + # @return [String] Client Id of the Application in the external Identity + # Provider. It is App ID for Facebook login, Client ID for Google login, + # App ID for Microsoft. + attr_accessor :client_id + + # @return [String] Client secret of the Application in external Identity + # Provider, used to authenticate login request. For example, it is App + # Secret for Facebook login, API Key for Google login, Public Key for + # Microsoft. + attr_accessor :client_secret + + + # + # Mapper for IdentityProviderUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IdentityProviderUpdateParameters', + type: { + name: 'Composite', + class_name: 'IdentityProviderUpdateParameters', + model_properties: { + type: { + required: false, + serialized_name: 'properties.type', + type: { + name: 'String' + } + }, + allowed_tenants: { + required: false, + serialized_name: 'properties.allowedTenants', + constraints: { + MaxItems: 32 + }, + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + signup_policy_name: { + required: false, + serialized_name: 'properties.signupPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + signin_policy_name: { + required: false, + serialized_name: 'properties.signinPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + profile_editing_policy_name: { + required: false, + serialized_name: 'properties.profileEditingPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + password_reset_policy_name: { + required: false, + serialized_name: 'properties.passwordResetPolicyName', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + client_id: { + required: false, + serialized_name: 'properties.clientId', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + client_secret: { + required: false, + serialized_name: 'properties.clientSecret', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_attachment_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_attachment_collection.rb new file mode 100644 index 0000000000..13d9c46b8c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_attachment_collection.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Issue Attachment list representation. + # + class IssueAttachmentCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Issue Attachment values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [IssueAttachmentCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for IssueAttachmentCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IssueAttachmentCollection', + type: { + name: 'Composite', + class_name: 'IssueAttachmentCollection', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'IssueAttachmentContractElementType', + type: { + name: 'Composite', + class_name: 'IssueAttachmentContract' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_attachment_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_attachment_contract.rb new file mode 100644 index 0000000000..3f4e0f0ac4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_attachment_contract.rb @@ -0,0 +1,90 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Issue Attachment Contract details. + # + class IssueAttachmentContract < Resource + + include MsRestAzure + + # @return [String] Filename by which the binary data will be saved. + attr_accessor :title + + # @return [String] Either 'link' if content is provided via an HTTP link + # or the MIME type of the Base64-encoded binary data provided in the + # 'content' property. + attr_accessor :content_format + + # @return [String] An HTTP link or Base64-encoded binary data. + attr_accessor :content + + + # + # Mapper for IssueAttachmentContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IssueAttachmentContract', + type: { + name: 'Composite', + class_name: 'IssueAttachmentContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + title: { + required: true, + serialized_name: 'properties.title', + type: { + name: 'String' + } + }, + content_format: { + required: true, + serialized_name: 'properties.contentFormat', + type: { + name: 'String' + } + }, + content: { + required: true, + serialized_name: 'properties.content', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_collection.rb new file mode 100644 index 0000000000..bf40e69e90 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_collection.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Issue list representation. + # + class IssueCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Issue values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [IssueCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for IssueCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IssueCollection', + type: { + name: 'Composite', + class_name: 'IssueCollection', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'IssueContractElementType', + type: { + name: 'Composite', + class_name: 'IssueContract' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_comment_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_comment_collection.rb new file mode 100644 index 0000000000..3a2da614b1 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_comment_collection.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Issue Comment list representation. + # + class IssueCommentCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Issue Comment values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [IssueCommentCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for IssueCommentCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IssueCommentCollection', + type: { + name: 'Composite', + class_name: 'IssueCommentCollection', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'IssueCommentContractElementType', + type: { + name: 'Composite', + class_name: 'IssueCommentContract' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_comment_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_comment_contract.rb new file mode 100644 index 0000000000..86993a80b5 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_comment_contract.rb @@ -0,0 +1,89 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Issue Comment Contract details. + # + class IssueCommentContract < Resource + + include MsRestAzure + + # @return [String] Comment text. + attr_accessor :text + + # @return [DateTime] Date and time when the comment was created. + attr_accessor :created_date + + # @return [String] A resource identifier for the user who left the + # comment. + attr_accessor :user_id + + + # + # Mapper for IssueCommentContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IssueCommentContract', + type: { + name: 'Composite', + class_name: 'IssueCommentContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + text: { + required: true, + serialized_name: 'properties.text', + type: { + name: 'String' + } + }, + created_date: { + required: false, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + user_id: { + required: true, + serialized_name: 'properties.userId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_contract.rb new file mode 100644 index 0000000000..3f5e0f7d2d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/issue_contract.rb @@ -0,0 +1,120 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Issue Contract details. + # + class IssueContract < Resource + + include MsRestAzure + + # @return [String] The issue title. + attr_accessor :title + + # @return [String] Text describing the issue. + attr_accessor :description + + # @return [DateTime] Date and time when the issue was created. + attr_accessor :created_date + + # @return [State] Status of the issue. Possible values include: + # 'proposed', 'open', 'removed', 'resolved', 'closed' + attr_accessor :state + + # @return [String] A resource identifier for the user created the issue. + attr_accessor :user_id + + # @return [String] A resource identifier for the API the issue was + # created for. + attr_accessor :api_id + + + # + # Mapper for IssueContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IssueContract', + type: { + name: 'Composite', + class_name: 'IssueContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + title: { + required: true, + serialized_name: 'properties.title', + type: { + name: 'String' + } + }, + description: { + required: true, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + created_date: { + required: false, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + state: { + required: false, + serialized_name: 'properties.state', + type: { + name: 'String' + } + }, + user_id: { + required: true, + serialized_name: 'properties.userId', + type: { + name: 'String' + } + }, + api_id: { + required: false, + serialized_name: 'properties.apiId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/key_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/key_type.rb new file mode 100644 index 0000000000..197d7b6e02 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/key_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for KeyType + # + module KeyType + Primary = "primary" + Secondary = "secondary" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_collection.rb new file mode 100644 index 0000000000..2f9a5db107 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_collection.rb @@ -0,0 +1,104 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Logger list representation. + # + class LoggerCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Logger values. + attr_accessor :value + + # @return [Integer] Total record count number across all pages. + attr_accessor :count + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [LoggerCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for LoggerCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'LoggerCollection', + type: { + name: 'Composite', + class_name: 'LoggerCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'LoggerContractElementType', + type: { + name: 'Composite', + class_name: 'LoggerContract' + } + } + } + }, + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_contract.rb new file mode 100644 index 0000000000..972d3644b4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_contract.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Logger details. + # + class LoggerContract < Resource + + include MsRestAzure + + # @return [LoggerType] Logger type. Possible values include: + # 'azureEventHub', 'applicationInsights' + attr_accessor :logger_type + + # @return [String] Logger description. + attr_accessor :description + + # @return [Hash{String => String}] The name and SendRule connection + # string of the event hub for azureEventHub logger. + # Instrumentation key for applicationInsights logger. + attr_accessor :credentials + + # @return [Boolean] Whether records are buffered in the logger before + # publishing. Default is assumed to be true. + attr_accessor :is_buffered + + + # + # Mapper for LoggerContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'LoggerContract', + type: { + name: 'Composite', + class_name: 'LoggerContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + logger_type: { + required: true, + serialized_name: 'properties.loggerType', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + constraints: { + MaxLength: 256 + }, + type: { + name: 'String' + } + }, + credentials: { + required: true, + serialized_name: 'properties.credentials', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + is_buffered: { + required: false, + serialized_name: 'properties.isBuffered', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_type.rb new file mode 100644 index 0000000000..f05c15062e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for LoggerType + # + module LoggerType + AzureEventHub = "azureEventHub" + ApplicationInsights = "applicationInsights" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_update_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_update_contract.rb new file mode 100644 index 0000000000..0f39e6e791 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/logger_update_contract.rb @@ -0,0 +1,83 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Logger update contract. + # + class LoggerUpdateContract + + include MsRestAzure + + # @return [LoggerType] Logger type. Possible values include: + # 'azureEventHub', 'applicationInsights' + attr_accessor :logger_type + + # @return [String] Logger description. + attr_accessor :description + + # @return [Hash{String => String}] Logger credentials. + attr_accessor :credentials + + # @return [Boolean] Whether records are buffered in the logger before + # publishing. Default is assumed to be true. + attr_accessor :is_buffered + + + # + # Mapper for LoggerUpdateContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'LoggerUpdateContract', + type: { + name: 'Composite', + class_name: 'LoggerUpdateContract', + model_properties: { + logger_type: { + required: false, + serialized_name: 'properties.loggerType', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + credentials: { + required: false, + serialized_name: 'properties.credentials', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + is_buffered: { + required: false, + serialized_name: 'properties.isBuffered', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/name_availability_reason.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/name_availability_reason.rb new file mode 100644 index 0000000000..5932c8490d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/name_availability_reason.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for NameAvailabilityReason + # + module NameAvailabilityReason + Valid = "Valid" + Invalid = "Invalid" + AlreadyExists = "AlreadyExists" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/network_status_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/network_status_contract.rb new file mode 100644 index 0000000000..4f0a49376e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/network_status_contract.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Network Status details. + # + class NetworkStatusContract + + include MsRestAzure + + # @return [Array] Gets the list of DNS servers IPV4 addresses. + attr_accessor :dns_servers + + # @return [Array] Gets the list of + # Connectivity Status to the Resources on which the service depends upon. + attr_accessor :connectivity_status + + + # + # Mapper for NetworkStatusContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NetworkStatusContract', + type: { + name: 'Composite', + class_name: 'NetworkStatusContract', + model_properties: { + dns_servers: { + required: true, + serialized_name: 'dnsServers', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + connectivity_status: { + required: true, + serialized_name: 'connectivityStatus', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ConnectivityStatusContractElementType', + type: { + name: 'Composite', + class_name: 'ConnectivityStatusContract' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/network_status_contract_by_location.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/network_status_contract_by_location.rb new file mode 100644 index 0000000000..f387d98e99 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/network_status_contract_by_location.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Network Status in the Location + # + class NetworkStatusContractByLocation + + include MsRestAzure + + # @return [String] Location of service + attr_accessor :location + + # @return [NetworkStatusContract] Network status in Location + attr_accessor :network_status + + + # + # Mapper for NetworkStatusContractByLocation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NetworkStatusContractByLocation', + type: { + name: 'Composite', + class_name: 'NetworkStatusContractByLocation', + model_properties: { + location: { + required: false, + serialized_name: 'location', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + network_status: { + required: false, + serialized_name: 'networkStatus', + type: { + name: 'Composite', + class_name: 'NetworkStatusContract' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_collection.rb new file mode 100644 index 0000000000..92520d7220 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Notification list representation. + # + class NotificationCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [NotificationCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for NotificationCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NotificationCollection', + type: { + name: 'Composite', + class_name: 'NotificationCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'NotificationContractElementType', + type: { + name: 'Composite', + class_name: 'NotificationContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_contract.rb new file mode 100644 index 0000000000..eff277bc97 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_contract.rb @@ -0,0 +1,93 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Notification details. + # + class NotificationContract < Resource + + include MsRestAzure + + # @return [String] Title of the Notification. + attr_accessor :title + + # @return [String] Description of the Notification. + attr_accessor :description + + # @return [RecipientsContractProperties] Recipient Parameter values. + attr_accessor :recipients + + + # + # Mapper for NotificationContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NotificationContract', + type: { + name: 'Composite', + class_name: 'NotificationContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + title: { + required: true, + serialized_name: 'properties.title', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + recipients: { + required: false, + serialized_name: 'properties.recipients', + type: { + name: 'Composite', + class_name: 'RecipientsContractProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_name.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_name.rb new file mode 100644 index 0000000000..3794be26ef --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/notification_name.rb @@ -0,0 +1,21 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for NotificationName + # + module NotificationName + RequestPublisherNotificationMessage = "RequestPublisherNotificationMessage" + PurchasePublisherNotificationMessage = "PurchasePublisherNotificationMessage" + NewApplicationNotificationMessage = "NewApplicationNotificationMessage" + BCC = "BCC" + NewIssuePublisherNotificationMessage = "NewIssuePublisherNotificationMessage" + AccountClosedPublisher = "AccountClosedPublisher" + QuotaLimitApproachingPublisherNotificationMessage = "QuotaLimitApproachingPublisherNotificationMessage" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb new file mode 100644 index 0000000000..17e4c8117f --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/oauth2authentication_settings_contract.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # API OAuth2 Authentication settings details. + # + class OAuth2AuthenticationSettingsContract + + include MsRestAzure + + # @return [String] OAuth authorization server identifier. + attr_accessor :authorization_server_id + + # @return [String] operations scope. + attr_accessor :scope + + + # + # Mapper for OAuth2AuthenticationSettingsContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OAuth2AuthenticationSettingsContract', + type: { + name: 'Composite', + class_name: 'OAuth2AuthenticationSettingsContract', + model_properties: { + authorization_server_id: { + required: false, + serialized_name: 'authorizationServerId', + type: { + name: 'String' + } + }, + scope: { + required: false, + serialized_name: 'scope', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb new file mode 100644 index 0000000000..8ff06e7b15 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/open_id_connect_provider_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged OpenIdProviders list representation. + # + class OpenIdConnectProviderCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [OpenIdConnectProviderCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for OpenIdConnectProviderCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OpenIdConnectProviderCollection', + type: { + name: 'Composite', + class_name: 'OpenIdConnectProviderCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OpenidConnectProviderContractElementType', + type: { + name: 'Composite', + class_name: 'OpenidConnectProviderContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb new file mode 100644 index 0000000000..ff73fc9ef9 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/openid_connect_provider_contract.rb @@ -0,0 +1,113 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # OpenId Connect Provider details. + # + class OpenidConnectProviderContract < Resource + + include MsRestAzure + + # @return [String] User-friendly OpenID Connect Provider name. + attr_accessor :display_name + + # @return [String] User-friendly description of OpenID Connect Provider. + attr_accessor :description + + # @return [String] Metadata endpoint URI. + attr_accessor :metadata_endpoint + + # @return [String] Client ID of developer console which is the client + # application. + attr_accessor :client_id + + # @return [String] Client Secret of developer console which is the client + # application. + attr_accessor :client_secret + + + # + # Mapper for OpenidConnectProviderContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OpenidConnectProviderContract', + type: { + name: 'Composite', + class_name: 'OpenidConnectProviderContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 50 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + metadata_endpoint: { + required: true, + serialized_name: 'properties.metadataEndpoint', + type: { + name: 'String' + } + }, + client_id: { + required: true, + serialized_name: 'properties.clientId', + type: { + name: 'String' + } + }, + client_secret: { + required: false, + serialized_name: 'properties.clientSecret', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb new file mode 100644 index 0000000000..700f9a9bbc --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/openid_connect_provider_update_contract.rb @@ -0,0 +1,89 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Update OpenID Connect Provider operation. + # + class OpenidConnectProviderUpdateContract + + include MsRestAzure + + # @return [String] User-friendly OpenID Connect Provider name. + attr_accessor :display_name + + # @return [String] User-friendly description of OpenID Connect Provider. + attr_accessor :description + + # @return [String] Metadata endpoint URI. + attr_accessor :metadata_endpoint + + # @return [String] Client ID of developer console which is the client + # application. + attr_accessor :client_id + + # @return [String] Client Secret of developer console which is the client + # application. + attr_accessor :client_secret + + + # + # Mapper for OpenidConnectProviderUpdateContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OpenidConnectProviderUpdateContract', + type: { + name: 'Composite', + class_name: 'OpenidConnectProviderUpdateContract', + model_properties: { + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 50 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + metadata_endpoint: { + required: false, + serialized_name: 'properties.metadataEndpoint', + type: { + name: 'String' + } + }, + client_id: { + required: false, + serialized_name: 'properties.clientId', + type: { + name: 'String' + } + }, + client_secret: { + required: false, + serialized_name: 'properties.clientSecret', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation.rb new file mode 100644 index 0000000000..013e8ae7f9 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation.rb @@ -0,0 +1,75 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # REST API operation + # + class Operation + + include MsRestAzure + + # @return [String] Operation name: {provider}/{resource}/{operation} + attr_accessor :name + + # @return [OperationDisplay] The object that describes the operation. + attr_accessor :display + + # @return [String] The operation origin. + attr_accessor :origin + + # @return The operation properties. + attr_accessor :properties + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationDisplay' + } + }, + origin: { + required: false, + serialized_name: 'origin', + type: { + name: 'String' + } + }, + properties: { + required: false, + serialized_name: 'properties', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_collection.rb new file mode 100644 index 0000000000..b318d19961 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_collection.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Operation list representation. + # + class OperationCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [OperationCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for OperationCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationCollection', + type: { + name: 'Composite', + class_name: 'OperationCollection', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OperationContractElementType', + type: { + name: 'Composite', + class_name: 'OperationContract' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_contract.rb new file mode 100644 index 0000000000..67fd00a98a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_contract.rb @@ -0,0 +1,171 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Api Operation details. + # + class OperationContract < Resource + + include MsRestAzure + + # @return [Array] Collection of URL template + # parameters. + attr_accessor :template_parameters + + # @return [String] Description of the operation. May include HTML + # formatting tags. + attr_accessor :description + + # @return [RequestContract] An entity containing request details. + attr_accessor :request + + # @return [Array] Array of Operation responses. + attr_accessor :responses + + # @return [String] Operation Policies + attr_accessor :policies + + # @return [String] Operation Name. + attr_accessor :display_name + + # @return [String] A Valid HTTP Operation Method. Typical Http Methods + # like GET, PUT, POST but not limited by only them. + attr_accessor :method + + # @return [String] Relative URL template identifying the target resource + # for this operation. May include parameters. Example: + # /customers/{cid}/orders/{oid}/?date={date} + attr_accessor :url_template + + + # + # Mapper for OperationContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationContract', + type: { + name: 'Composite', + class_name: 'OperationContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + template_parameters: { + required: false, + serialized_name: 'properties.templateParameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ParameterContractElementType', + type: { + name: 'Composite', + class_name: 'ParameterContract' + } + } + } + }, + description: { + required: false, + serialized_name: 'properties.description', + constraints: { + MaxLength: 1000 + }, + type: { + name: 'String' + } + }, + request: { + required: false, + serialized_name: 'properties.request', + type: { + name: 'Composite', + class_name: 'RequestContract' + } + }, + responses: { + required: false, + serialized_name: 'properties.responses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ResponseContractElementType', + type: { + name: 'Composite', + class_name: 'ResponseContract' + } + } + } + }, + policies: { + required: false, + serialized_name: 'properties.policies', + type: { + name: 'String' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + method: { + required: true, + serialized_name: 'properties.method', + type: { + name: 'String' + } + }, + url_template: { + required: true, + serialized_name: 'properties.urlTemplate', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_display.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_display.rb new file mode 100644 index 0000000000..328986f525 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_display.rb @@ -0,0 +1,75 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # The object that describes the operation. + # + class OperationDisplay + + include MsRestAzure + + # @return [String] Friendly name of the resource provider + attr_accessor :provider + + # @return [String] Operation type: read, write, delete, listKeys/action, + # etc. + attr_accessor :operation + + # @return [String] Resource type on which the operation is performed. + attr_accessor :resource + + # @return [String] Friendly name of the operation + attr_accessor :description + + + # + # Mapper for OperationDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation_display', + type: { + name: 'Composite', + class_name: 'OperationDisplay', + model_properties: { + provider: { + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + operation: { + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + resource: { + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_entity_base_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_entity_base_contract.rb new file mode 100644 index 0000000000..6813f6337d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_entity_base_contract.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Api Operation Entity Base Contract details. + # + class OperationEntityBaseContract + + include MsRestAzure + + # @return [Array] Collection of URL template + # parameters. + attr_accessor :template_parameters + + # @return [String] Description of the operation. May include HTML + # formatting tags. + attr_accessor :description + + # @return [RequestContract] An entity containing request details. + attr_accessor :request + + # @return [Array] Array of Operation responses. + attr_accessor :responses + + # @return [String] Operation Policies + attr_accessor :policies + + + # + # Mapper for OperationEntityBaseContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationEntityBaseContract', + type: { + name: 'Composite', + class_name: 'OperationEntityBaseContract', + model_properties: { + template_parameters: { + required: false, + serialized_name: 'templateParameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ParameterContractElementType', + type: { + name: 'Composite', + class_name: 'ParameterContract' + } + } + } + }, + description: { + required: false, + serialized_name: 'description', + constraints: { + MaxLength: 1000 + }, + type: { + name: 'String' + } + }, + request: { + required: false, + serialized_name: 'request', + type: { + name: 'Composite', + class_name: 'RequestContract' + } + }, + responses: { + required: false, + serialized_name: 'responses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ResponseContractElementType', + type: { + name: 'Composite', + class_name: 'ResponseContract' + } + } + } + }, + policies: { + required: false, + serialized_name: 'policies', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_list_result.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_list_result.rb new file mode 100644 index 0000000000..fa698d5299 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_list_result.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Result of the request to list REST API operations. It contains a list of + # operations and a URL nextLink to get the next set of results. + # + class OperationListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] List of operations supported by the resource + # provider. + attr_accessor :value + + # @return [String] URL to get the next set of operation list results if + # there are any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [OperationListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for OperationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationListResult', + type: { + name: 'Composite', + class_name: 'OperationListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_result_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_result_contract.rb new file mode 100644 index 0000000000..d6595b42c3 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_result_contract.rb @@ -0,0 +1,125 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Operation Result. + # + class OperationResultContract + + include MsRestAzure + + # @return [String] Operation result identifier. + attr_accessor :id + + # @return [AsyncOperationStatus] Status of an async operation. Possible + # values include: 'Started', 'InProgress', 'Succeeded', 'Failed' + attr_accessor :status + + # @return [DateTime] Start time of an async operation. The date conforms + # to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + # 8601 standard. + # + attr_accessor :started + + # @return [DateTime] Last update time of an async operation. The date + # conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + # by the ISO 8601 standard. + # + attr_accessor :updated + + # @return [String] Optional result info. + attr_accessor :result_info + + # @return [ErrorResponse] Error Body Contract + attr_accessor :error + + # @return [Array] This property if only + # provided as part of the TenantConfiguration_Validate operation. It + # contains the log the entities which will be updated/created/deleted as + # part of the TenantConfiguration_Deploy operation. + attr_accessor :action_log + + + # + # Mapper for OperationResultContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationResultContract', + type: { + name: 'Composite', + class_name: 'OperationResultContract', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + status: { + required: false, + serialized_name: 'status', + type: { + name: 'Enum', + module: 'AsyncOperationStatus' + } + }, + started: { + required: false, + serialized_name: 'started', + type: { + name: 'DateTime' + } + }, + updated: { + required: false, + serialized_name: 'updated', + type: { + name: 'DateTime' + } + }, + result_info: { + required: false, + serialized_name: 'resultInfo', + type: { + name: 'String' + } + }, + error: { + required: false, + serialized_name: 'error', + type: { + name: 'Composite', + class_name: 'ErrorResponse' + } + }, + action_log: { + required: false, + read_only: true, + serialized_name: 'actionLog', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OperationResultLogItemContractElementType', + type: { + name: 'Composite', + class_name: 'OperationResultLogItemContract' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_result_log_item_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_result_log_item_contract.rb new file mode 100644 index 0000000000..6af9929e01 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_result_log_item_contract.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Log of the entity being created, updated or deleted. + # + class OperationResultLogItemContract + + include MsRestAzure + + # @return [String] The type of entity contract. + attr_accessor :object_type + + # @return [String] Action like create/update/delete. + attr_accessor :action + + # @return [String] Identifier of the entity being + # created/updated/deleted. + attr_accessor :object_key + + + # + # Mapper for OperationResultLogItemContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationResultLogItemContract', + type: { + name: 'Composite', + class_name: 'OperationResultLogItemContract', + model_properties: { + object_type: { + required: false, + serialized_name: 'objectType', + type: { + name: 'String' + } + }, + action: { + required: false, + serialized_name: 'action', + type: { + name: 'String' + } + }, + object_key: { + required: false, + serialized_name: 'objectKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_tag_resource_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_tag_resource_contract_properties.rb new file mode 100644 index 0000000000..8e501c6781 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_tag_resource_contract_properties.rb @@ -0,0 +1,125 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Operation Entity contract Properties. + # + class OperationTagResourceContractProperties + + include MsRestAzure + + # @return [String] Identifier of the operation in form + # /operations/{operationId}. + attr_accessor :id + + # @return [String] Operation name. + attr_accessor :name + + # @return [String] Api Name. + attr_accessor :api_name + + # @return [String] Api Revision. + attr_accessor :api_revision + + # @return [String] Api Version. + attr_accessor :api_version + + # @return [String] Operation Description. + attr_accessor :description + + # @return [String] A Valid HTTP Operation Method. Typical Http Methods + # like GET, PUT, POST but not limited by only them. + attr_accessor :method + + # @return [String] Relative URL template identifying the target resource + # for this operation. May include parameters. Example: + # /customers/{cid}/orders/{oid}/?date={date} + attr_accessor :url_template + + + # + # Mapper for OperationTagResourceContractProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationTagResourceContractProperties', + type: { + name: 'Composite', + class_name: 'OperationTagResourceContractProperties', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + api_name: { + required: false, + read_only: true, + serialized_name: 'apiName', + type: { + name: 'String' + } + }, + api_revision: { + required: false, + read_only: true, + serialized_name: 'apiRevision', + type: { + name: 'String' + } + }, + api_version: { + required: false, + read_only: true, + serialized_name: 'apiVersion', + type: { + name: 'String' + } + }, + description: { + required: false, + read_only: true, + serialized_name: 'description', + type: { + name: 'String' + } + }, + method: { + required: false, + read_only: true, + serialized_name: 'method', + type: { + name: 'String' + } + }, + url_template: { + required: false, + read_only: true, + serialized_name: 'urlTemplate', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_update_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_update_contract.rb new file mode 100644 index 0000000000..1e504ca3af --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/operation_update_contract.rb @@ -0,0 +1,147 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Api Operation Update Contract details. + # + class OperationUpdateContract + + include MsRestAzure + + # @return [Array] Collection of URL template + # parameters. + attr_accessor :template_parameters + + # @return [String] Description of the operation. May include HTML + # formatting tags. + attr_accessor :description + + # @return [RequestContract] An entity containing request details. + attr_accessor :request + + # @return [Array] Array of Operation responses. + attr_accessor :responses + + # @return [String] Operation Policies + attr_accessor :policies + + # @return [String] Operation Name. + attr_accessor :display_name + + # @return [String] A Valid HTTP Operation Method. Typical Http Methods + # like GET, PUT, POST but not limited by only them. + attr_accessor :method + + # @return [String] Relative URL template identifying the target resource + # for this operation. May include parameters. Example: + # /customers/{cid}/orders/{oid}/?date={date} + attr_accessor :url_template + + + # + # Mapper for OperationUpdateContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationUpdateContract', + type: { + name: 'Composite', + class_name: 'OperationUpdateContract', + model_properties: { + template_parameters: { + required: false, + serialized_name: 'properties.templateParameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ParameterContractElementType', + type: { + name: 'Composite', + class_name: 'ParameterContract' + } + } + } + }, + description: { + required: false, + serialized_name: 'properties.description', + constraints: { + MaxLength: 1000 + }, + type: { + name: 'String' + } + }, + request: { + required: false, + serialized_name: 'properties.request', + type: { + name: 'Composite', + class_name: 'RequestContract' + } + }, + responses: { + required: false, + serialized_name: 'properties.responses', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ResponseContractElementType', + type: { + name: 'Composite', + class_name: 'ResponseContract' + } + } + } + }, + policies: { + required: false, + serialized_name: 'properties.policies', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + method: { + required: false, + serialized_name: 'properties.method', + type: { + name: 'String' + } + }, + url_template: { + required: false, + serialized_name: 'properties.urlTemplate', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/parameter_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/parameter_contract.rb new file mode 100644 index 0000000000..e196cd2b41 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/parameter_contract.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Operation parameters details. + # + class ParameterContract + + include MsRestAzure + + # @return [String] Parameter name. + attr_accessor :name + + # @return [String] Parameter description. + attr_accessor :description + + # @return [String] Parameter type. + attr_accessor :type + + # @return [String] Default parameter value. + attr_accessor :default_value + + # @return [Boolean] whether parameter is required or not. + attr_accessor :required + + # @return [Array] Parameter values. + attr_accessor :values + + + # + # Mapper for ParameterContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ParameterContract', + type: { + name: 'Composite', + class_name: 'ParameterContract', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + type: { + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + default_value: { + required: false, + serialized_name: 'defaultValue', + type: { + name: 'String' + } + }, + required: { + required: false, + serialized_name: 'required', + type: { + name: 'Boolean' + } + }, + values: { + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_collection.rb new file mode 100644 index 0000000000..3a382ab8a4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_collection.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # The response of the list policy operation. + # + class PolicyCollection + + include MsRestAzure + + # @return [Array] Policy Contract value. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + + # + # Mapper for PolicyCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PolicyCollection', + type: { + name: 'Composite', + class_name: 'PolicyCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'PolicyContractElementType', + type: { + name: 'Composite', + class_name: 'PolicyContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_content_format.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_content_format.rb new file mode 100644 index 0000000000..99c9f3648c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_content_format.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for PolicyContentFormat + # + module PolicyContentFormat + Xml = "xml" + XmlLink = "xml-link" + Rawxml = "rawxml" + RawxmlLink = "rawxml-link" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_contract.rb new file mode 100644 index 0000000000..d9bdc81cdf --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_contract.rb @@ -0,0 +1,81 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Policy Contract details. + # + class PolicyContract < Resource + + include MsRestAzure + + # @return [String] Json escaped Xml Encoded contents of the Policy. + attr_accessor :policy_content + + # @return [PolicyContentFormat] Format of the policyContent. Possible + # values include: 'xml', 'xml-link', 'rawxml', 'rawxml-link'. Default + # value: 'xml' . + attr_accessor :content_format + + + # + # Mapper for PolicyContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PolicyContract', + type: { + name: 'Composite', + class_name: 'PolicyContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + policy_content: { + required: true, + serialized_name: 'properties.policyContent', + type: { + name: 'String' + } + }, + content_format: { + required: false, + serialized_name: 'properties.contentFormat', + default_value: 'xml', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_scope_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_scope_contract.rb new file mode 100644 index 0000000000..ddd04df547 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_scope_contract.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for PolicyScopeContract + # + module PolicyScopeContract + Tenant = "Tenant" + Product = "Product" + Api = "Api" + Operation = "Operation" + All = "All" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb new file mode 100644 index 0000000000..ae697a33ab --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_snippet_contract.rb @@ -0,0 +1,78 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Policy snippet. + # + class PolicySnippetContract + + include MsRestAzure + + # @return [String] Snippet name. + attr_accessor :name + + # @return [String] Snippet content. + attr_accessor :content + + # @return [String] Snippet toolTip. + attr_accessor :tool_tip + + # @return [Integer] Binary OR value of the Snippet scope. + attr_accessor :scope + + + # + # Mapper for PolicySnippetContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PolicySnippetContract', + type: { + name: 'Composite', + class_name: 'PolicySnippetContract', + model_properties: { + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + content: { + required: false, + read_only: true, + serialized_name: 'content', + type: { + name: 'String' + } + }, + tool_tip: { + required: false, + read_only: true, + serialized_name: 'toolTip', + type: { + name: 'String' + } + }, + scope: { + required: false, + read_only: true, + serialized_name: 'scope', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_snippets_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_snippets_collection.rb new file mode 100644 index 0000000000..a26da46697 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/policy_snippets_collection.rb @@ -0,0 +1,52 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # The response of the list policy snippets operation. + # + class PolicySnippetsCollection + + include MsRestAzure + + # @return [Array] Policy snippet value. + attr_accessor :value + + + # + # Mapper for PolicySnippetsCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PolicySnippetsCollection', + type: { + name: 'Composite', + class_name: 'PolicySnippetsCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'PolicySnippetContractElementType', + type: { + name: 'Composite', + class_name: 'PolicySnippetContract' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_delegation_settings.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_delegation_settings.rb new file mode 100644 index 0000000000..08204cbabd --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_delegation_settings.rb @@ -0,0 +1,103 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Delegation settings for a developer portal. + # + class PortalDelegationSettings < Resource + + include MsRestAzure + + # @return [String] A delegation Url. + attr_accessor :url + + # @return [String] A base64-encoded validation key to validate, that a + # request is coming from Azure API Management. + attr_accessor :validation_key + + # @return [SubscriptionsDelegationSettingsProperties] Subscriptions + # delegation settings. + attr_accessor :subscriptions + + # @return [RegistrationDelegationSettingsProperties] User registration + # delegation settings. + attr_accessor :user_registration + + + # + # Mapper for PortalDelegationSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PortalDelegationSettings', + type: { + name: 'Composite', + class_name: 'PortalDelegationSettings', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + url: { + required: false, + serialized_name: 'properties.url', + type: { + name: 'String' + } + }, + validation_key: { + required: false, + serialized_name: 'properties.validationKey', + type: { + name: 'String' + } + }, + subscriptions: { + required: false, + serialized_name: 'properties.subscriptions', + type: { + name: 'Composite', + class_name: 'SubscriptionsDelegationSettingsProperties' + } + }, + user_registration: { + required: false, + serialized_name: 'properties.userRegistration', + type: { + name: 'Composite', + class_name: 'RegistrationDelegationSettingsProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_signin_settings.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_signin_settings.rb new file mode 100644 index 0000000000..6ea43ab3d3 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_signin_settings.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Sign-In settings for the Developer Portal. + # + class PortalSigninSettings < Resource + + include MsRestAzure + + # @return [Boolean] Redirect Anonymous users to the Sign-In page. + attr_accessor :enabled + + + # + # Mapper for PortalSigninSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PortalSigninSettings', + type: { + name: 'Composite', + class_name: 'PortalSigninSettings', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + enabled: { + required: false, + serialized_name: 'properties.enabled', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_signup_settings.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_signup_settings.rb new file mode 100644 index 0000000000..473d0ecfa0 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/portal_signup_settings.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Sign-Up settings for a developer portal. + # + class PortalSignupSettings < Resource + + include MsRestAzure + + # @return [Boolean] Allow users to sign up on a developer portal. + attr_accessor :enabled + + # @return [TermsOfServiceProperties] Terms of service contract + # properties. + attr_accessor :terms_of_service + + + # + # Mapper for PortalSignupSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PortalSignupSettings', + type: { + name: 'Composite', + class_name: 'PortalSignupSettings', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + enabled: { + required: false, + serialized_name: 'properties.enabled', + type: { + name: 'Boolean' + } + }, + terms_of_service: { + required: false, + serialized_name: 'properties.termsOfService', + type: { + name: 'Composite', + class_name: 'TermsOfServiceProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_collection.rb new file mode 100644 index 0000000000..2d0a2882b8 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Products list representation. + # + class ProductCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ProductCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ProductCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ProductCollection', + type: { + name: 'Composite', + class_name: 'ProductCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ProductContractElementType', + type: { + name: 'Composite', + class_name: 'ProductContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_contract.rb new file mode 100644 index 0000000000..597ac4cf73 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_contract.rb @@ -0,0 +1,156 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Product details. + # + class ProductContract < Resource + + include MsRestAzure + + # @return [String] Product description. May include HTML formatting tags. + attr_accessor :description + + # @return [String] Product terms of use. Developers trying to subscribe + # to the product will be presented and required to accept these terms + # before they can complete the subscription process. + attr_accessor :terms + + # @return [Boolean] Whether a product subscription is required for + # accessing APIs included in this product. If true, the product is + # referred to as "protected" and a valid subscription key is required for + # a request to an API included in the product to succeed. If false, the + # product is referred to as "open" and requests to an API included in the + # product can be made without a subscription key. If property is omitted + # when creating a new product it's value is assumed to be true. + attr_accessor :subscription_required + + # @return [Boolean] whether subscription approval is required. If false, + # new subscriptions will be approved automatically enabling developers to + # call the product’s APIs immediately after subscribing. If true, + # administrators must manually approve the subscription before the + # developer can any of the product’s APIs. Can be present only if + # subscriptionRequired property is present and has a value of false. + attr_accessor :approval_required + + # @return [Integer] Whether the number of subscriptions a user can have + # to this product at the same time. Set to null or omit to allow + # unlimited per user subscriptions. Can be present only if + # subscriptionRequired property is present and has a value of false. + attr_accessor :subscriptions_limit + + # @return [ProductState] whether product is published or not. Published + # products are discoverable by users of developer portal. Non published + # products are visible only to administrators. Default state of Product + # is notPublished. Possible values include: 'notPublished', 'published' + attr_accessor :state + + # @return [String] Product name. + attr_accessor :display_name + + + # + # Mapper for ProductContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ProductContract', + type: { + name: 'Composite', + class_name: 'ProductContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + terms: { + required: false, + serialized_name: 'properties.terms', + type: { + name: 'String' + } + }, + subscription_required: { + required: false, + serialized_name: 'properties.subscriptionRequired', + type: { + name: 'Boolean' + } + }, + approval_required: { + required: false, + serialized_name: 'properties.approvalRequired', + type: { + name: 'Boolean' + } + }, + subscriptions_limit: { + required: false, + serialized_name: 'properties.subscriptionsLimit', + type: { + name: 'Number' + } + }, + state: { + required: false, + serialized_name: 'properties.state', + type: { + name: 'Enum', + module: 'ProductState' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_entity_base_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_entity_base_parameters.rb new file mode 100644 index 0000000000..5e911b42a1 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_entity_base_parameters.rb @@ -0,0 +1,118 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Product Entity Base Parameters + # + class ProductEntityBaseParameters + + include MsRestAzure + + # @return [String] Product description. May include HTML formatting tags. + attr_accessor :description + + # @return [String] Product terms of use. Developers trying to subscribe + # to the product will be presented and required to accept these terms + # before they can complete the subscription process. + attr_accessor :terms + + # @return [Boolean] Whether a product subscription is required for + # accessing APIs included in this product. If true, the product is + # referred to as "protected" and a valid subscription key is required for + # a request to an API included in the product to succeed. If false, the + # product is referred to as "open" and requests to an API included in the + # product can be made without a subscription key. If property is omitted + # when creating a new product it's value is assumed to be true. + attr_accessor :subscription_required + + # @return [Boolean] whether subscription approval is required. If false, + # new subscriptions will be approved automatically enabling developers to + # call the product’s APIs immediately after subscribing. If true, + # administrators must manually approve the subscription before the + # developer can any of the product’s APIs. Can be present only if + # subscriptionRequired property is present and has a value of false. + attr_accessor :approval_required + + # @return [Integer] Whether the number of subscriptions a user can have + # to this product at the same time. Set to null or omit to allow + # unlimited per user subscriptions. Can be present only if + # subscriptionRequired property is present and has a value of false. + attr_accessor :subscriptions_limit + + # @return [ProductState] whether product is published or not. Published + # products are discoverable by users of developer portal. Non published + # products are visible only to administrators. Default state of Product + # is notPublished. Possible values include: 'notPublished', 'published' + attr_accessor :state + + + # + # Mapper for ProductEntityBaseParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ProductEntityBaseParameters', + type: { + name: 'Composite', + class_name: 'ProductEntityBaseParameters', + model_properties: { + description: { + required: false, + serialized_name: 'description', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + terms: { + required: false, + serialized_name: 'terms', + type: { + name: 'String' + } + }, + subscription_required: { + required: false, + serialized_name: 'subscriptionRequired', + type: { + name: 'Boolean' + } + }, + approval_required: { + required: false, + serialized_name: 'approvalRequired', + type: { + name: 'Boolean' + } + }, + subscriptions_limit: { + required: false, + serialized_name: 'subscriptionsLimit', + type: { + name: 'Number' + } + }, + state: { + required: false, + serialized_name: 'state', + type: { + name: 'Enum', + module: 'ProductState' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_state.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_state.rb new file mode 100644 index 0000000000..71463a3149 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_state.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for ProductState + # + module ProductState + NotPublished = "notPublished" + Published = "published" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_tag_resource_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_tag_resource_contract_properties.rb new file mode 100644 index 0000000000..b4c643f894 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_tag_resource_contract_properties.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Product profile. + # + class ProductTagResourceContractProperties < ProductEntityBaseParameters + + include MsRestAzure + + # @return [String] Identifier of the product in the form of + # /products/{productId} + attr_accessor :id + + # @return [String] Product name. + attr_accessor :name + + + # + # Mapper for ProductTagResourceContractProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ProductTagResourceContractProperties', + type: { + name: 'Composite', + class_name: 'ProductTagResourceContractProperties', + model_properties: { + description: { + required: false, + serialized_name: 'description', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + terms: { + required: false, + serialized_name: 'terms', + type: { + name: 'String' + } + }, + subscription_required: { + required: false, + serialized_name: 'subscriptionRequired', + type: { + name: 'Boolean' + } + }, + approval_required: { + required: false, + serialized_name: 'approvalRequired', + type: { + name: 'Boolean' + } + }, + subscriptions_limit: { + required: false, + serialized_name: 'subscriptionsLimit', + type: { + name: 'Number' + } + }, + state: { + required: false, + serialized_name: 'state', + type: { + name: 'Enum', + module: 'ProductState' + } + }, + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: true, + serialized_name: 'name', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_update_parameters.rb new file mode 100644 index 0000000000..65db033075 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/product_update_parameters.rb @@ -0,0 +1,132 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Product Update parameters. + # + class ProductUpdateParameters + + include MsRestAzure + + # @return [String] Product description. May include HTML formatting tags. + attr_accessor :description + + # @return [String] Product terms of use. Developers trying to subscribe + # to the product will be presented and required to accept these terms + # before they can complete the subscription process. + attr_accessor :terms + + # @return [Boolean] Whether a product subscription is required for + # accessing APIs included in this product. If true, the product is + # referred to as "protected" and a valid subscription key is required for + # a request to an API included in the product to succeed. If false, the + # product is referred to as "open" and requests to an API included in the + # product can be made without a subscription key. If property is omitted + # when creating a new product it's value is assumed to be true. + attr_accessor :subscription_required + + # @return [Boolean] whether subscription approval is required. If false, + # new subscriptions will be approved automatically enabling developers to + # call the product’s APIs immediately after subscribing. If true, + # administrators must manually approve the subscription before the + # developer can any of the product’s APIs. Can be present only if + # subscriptionRequired property is present and has a value of false. + attr_accessor :approval_required + + # @return [Integer] Whether the number of subscriptions a user can have + # to this product at the same time. Set to null or omit to allow + # unlimited per user subscriptions. Can be present only if + # subscriptionRequired property is present and has a value of false. + attr_accessor :subscriptions_limit + + # @return [ProductState] whether product is published or not. Published + # products are discoverable by users of developer portal. Non published + # products are visible only to administrators. Default state of Product + # is notPublished. Possible values include: 'notPublished', 'published' + attr_accessor :state + + # @return [String] Product name. + attr_accessor :display_name + + + # + # Mapper for ProductUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ProductUpdateParameters', + type: { + name: 'Composite', + class_name: 'ProductUpdateParameters', + model_properties: { + description: { + required: false, + serialized_name: 'properties.description', + constraints: { + MaxLength: 1000, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + terms: { + required: false, + serialized_name: 'properties.terms', + type: { + name: 'String' + } + }, + subscription_required: { + required: false, + serialized_name: 'properties.subscriptionRequired', + type: { + name: 'Boolean' + } + }, + approval_required: { + required: false, + serialized_name: 'properties.approvalRequired', + type: { + name: 'Boolean' + } + }, + subscriptions_limit: { + required: false, + serialized_name: 'properties.subscriptionsLimit', + type: { + name: 'Number' + } + }, + state: { + required: false, + serialized_name: 'properties.state', + type: { + name: 'Enum', + module: 'ProductState' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 300, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_collection.rb new file mode 100644 index 0000000000..5fbb8adf8e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Property list representation. + # + class PropertyCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [PropertyCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for PropertyCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PropertyCollection', + type: { + name: 'Composite', + class_name: 'PropertyCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'PropertyContractElementType', + type: { + name: 'Composite', + class_name: 'PropertyContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_contract.rb new file mode 100644 index 0000000000..89871b4db6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_contract.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Property details. + # + class PropertyContract < Resource + + include MsRestAzure + + # @return [Array] Optional tags that when provided can be used to + # filter the property list. + attr_accessor :tags + + # @return [Boolean] Determines whether the value is a secret and should + # be encrypted or not. Default value is false. + attr_accessor :secret + + # @return [String] Unique name of Property. It may contain only letters, + # digits, period, dash, and underscore characters. + attr_accessor :display_name + + # @return [String] Value of the property. Can contain policy expressions. + # It may not be empty or consist only of whitespace. + attr_accessor :value + + + # + # Mapper for PropertyContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PropertyContract', + type: { + name: 'Composite', + class_name: 'PropertyContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'properties.tags', + constraints: { + MaxItems: 32 + }, + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + secret: { + required: false, + serialized_name: 'properties.secret', + type: { + name: 'Boolean' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 256, + MinLength: 1, + Pattern: '^[A-Za-z0-9-._]+$' + }, + type: { + name: 'String' + } + }, + value: { + required: true, + serialized_name: 'properties.value', + constraints: { + MaxLength: 4096, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_entity_base_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_entity_base_parameters.rb new file mode 100644 index 0000000000..663e26a877 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_entity_base_parameters.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Property Entity Base Parameters set. + # + class PropertyEntityBaseParameters + + include MsRestAzure + + # @return [Array] Optional tags that when provided can be used to + # filter the property list. + attr_accessor :tags + + # @return [Boolean] Determines whether the value is a secret and should + # be encrypted or not. Default value is false. + attr_accessor :secret + + + # + # Mapper for PropertyEntityBaseParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PropertyEntityBaseParameters', + type: { + name: 'Composite', + class_name: 'PropertyEntityBaseParameters', + model_properties: { + tags: { + required: false, + serialized_name: 'tags', + constraints: { + MaxItems: 32 + }, + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + secret: { + required: false, + serialized_name: 'secret', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_update_parameters.rb new file mode 100644 index 0000000000..0da156ea47 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/property_update_parameters.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Property update Parameters. + # + class PropertyUpdateParameters + + include MsRestAzure + + # @return [Array] Optional tags that when provided can be used to + # filter the property list. + attr_accessor :tags + + # @return [Boolean] Determines whether the value is a secret and should + # be encrypted or not. Default value is false. + attr_accessor :secret + + # @return [String] Unique name of Property. It may contain only letters, + # digits, period, dash, and underscore characters. + attr_accessor :display_name + + # @return [String] Value of the property. Can contain policy expressions. + # It may not be empty or consist only of whitespace. + attr_accessor :value + + + # + # Mapper for PropertyUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PropertyUpdateParameters', + type: { + name: 'Composite', + class_name: 'PropertyUpdateParameters', + model_properties: { + tags: { + required: false, + serialized_name: 'properties.tags', + constraints: { + MaxItems: 32 + }, + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + secret: { + required: false, + serialized_name: 'properties.secret', + type: { + name: 'Boolean' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 256, + MinLength: 1, + Pattern: '^[A-Za-z0-9-._]+$' + }, + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'properties.value', + constraints: { + MaxLength: 4096, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/protocol.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/protocol.rb new file mode 100644 index 0000000000..cdbd304179 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for Protocol + # + module Protocol + Http = "http" + Https = "https" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_collection.rb new file mode 100644 index 0000000000..c8303da2d4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_collection.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Quota Counter list representation. + # + class QuotaCounterCollection + + include MsRestAzure + + # @return [Array] Quota counter values. + attr_accessor :value + + # @return [Integer] Total record count number across all pages. + attr_accessor :count + + # @return [String] Next page link if any. + attr_accessor :next_link + + + # + # Mapper for QuotaCounterCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'QuotaCounterCollection', + type: { + name: 'Composite', + class_name: 'QuotaCounterCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'QuotaCounterContractElementType', + type: { + name: 'Composite', + class_name: 'QuotaCounterContract' + } + } + } + }, + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_contract.rb new file mode 100644 index 0000000000..0313119dc4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_contract.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Quota counter details. + # + class QuotaCounterContract + + include MsRestAzure + + # @return [String] The Key value of the Counter. Must not be empty. + attr_accessor :counter_key + + # @return [String] Identifier of the Period for which the counter was + # collected. Must not be empty. + attr_accessor :period_key + + # @return [DateTime] The date of the start of Counter Period. The date + # conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + # by the ISO 8601 standard. + # + attr_accessor :period_start_time + + # @return [DateTime] The date of the end of Counter Period. The date + # conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + # by the ISO 8601 standard. + # + attr_accessor :period_end_time + + # @return [QuotaCounterValueContractProperties] Quota Value Properties + attr_accessor :value + + + # + # Mapper for QuotaCounterContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'QuotaCounterContract', + type: { + name: 'Composite', + class_name: 'QuotaCounterContract', + model_properties: { + counter_key: { + required: true, + serialized_name: 'counterKey', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + period_key: { + required: true, + serialized_name: 'periodKey', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + period_start_time: { + required: true, + serialized_name: 'periodStartTime', + type: { + name: 'DateTime' + } + }, + period_end_time: { + required: true, + serialized_name: 'periodEndTime', + type: { + name: 'DateTime' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Composite', + class_name: 'QuotaCounterValueContractProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb new file mode 100644 index 0000000000..655a321e15 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_value_contract.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Quota counter value details. + # + class QuotaCounterValueContract + + include MsRestAzure + + # @return [Integer] Number of times Counter was called. + attr_accessor :calls_count + + # @return [Float] Data Transferred in KiloBytes. + attr_accessor :kb_transferred + + + # + # Mapper for QuotaCounterValueContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'QuotaCounterValueContract', + type: { + name: 'Composite', + class_name: 'QuotaCounterValueContract', + model_properties: { + calls_count: { + required: false, + serialized_name: 'value.callsCount', + type: { + name: 'Number' + } + }, + kb_transferred: { + required: false, + serialized_name: 'value.kbTransferred', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_value_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_value_contract_properties.rb new file mode 100644 index 0000000000..54be8d003b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/quota_counter_value_contract_properties.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Quota counter value details. + # + class QuotaCounterValueContractProperties + + include MsRestAzure + + # @return [Integer] Number of times Counter was called. + attr_accessor :calls_count + + # @return [Float] Data Transferred in KiloBytes. + attr_accessor :kb_transferred + + + # + # Mapper for QuotaCounterValueContractProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'QuotaCounterValueContractProperties', + type: { + name: 'Composite', + class_name: 'QuotaCounterValueContractProperties', + model_properties: { + calls_count: { + required: false, + serialized_name: 'callsCount', + type: { + name: 'Number' + } + }, + kb_transferred: { + required: false, + serialized_name: 'kbTransferred', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_email_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_email_collection.rb new file mode 100644 index 0000000000..f6f323b4a0 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_email_collection.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Recipient User list representation. + # + class RecipientEmailCollection + + include MsRestAzure + + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + + # + # Mapper for RecipientEmailCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RecipientEmailCollection', + type: { + name: 'Composite', + class_name: 'RecipientEmailCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RecipientEmailContractElementType', + type: { + name: 'Composite', + class_name: 'RecipientEmailContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_email_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_email_contract.rb new file mode 100644 index 0000000000..d0e0a72f4d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_email_contract.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Recipient Email details. + # + class RecipientEmailContract < Resource + + include MsRestAzure + + # @return [String] User Email subscribed to notification. + attr_accessor :email + + + # + # Mapper for RecipientEmailContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RecipientEmailContract', + type: { + name: 'Composite', + class_name: 'RecipientEmailContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + email: { + required: false, + serialized_name: 'properties.email', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_user_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_user_collection.rb new file mode 100644 index 0000000000..09c53a1f03 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_user_collection.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Recipient User list representation. + # + class RecipientUserCollection + + include MsRestAzure + + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + + # + # Mapper for RecipientUserCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RecipientUserCollection', + type: { + name: 'Composite', + class_name: 'RecipientUserCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RecipientUserContractElementType', + type: { + name: 'Composite', + class_name: 'RecipientUserContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_user_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_user_contract.rb new file mode 100644 index 0000000000..8d26c350f5 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipient_user_contract.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Recipient User details. + # + class RecipientUserContract < Resource + + include MsRestAzure + + # @return [String] API Management UserId subscribed to notification. + attr_accessor :user_id + + + # + # Mapper for RecipientUserContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RecipientUserContract', + type: { + name: 'Composite', + class_name: 'RecipientUserContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + user_id: { + required: false, + serialized_name: 'properties.userId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipients_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipients_contract_properties.rb new file mode 100644 index 0000000000..fe71717c5c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/recipients_contract_properties.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Notification Parameter contract. + # + class RecipientsContractProperties + + include MsRestAzure + + # @return [Array] List of Emails subscribed for the notification. + attr_accessor :emails + + # @return [Array] List of Users subscribed for the notification. + attr_accessor :users + + + # + # Mapper for RecipientsContractProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RecipientsContractProperties', + type: { + name: 'Composite', + class_name: 'RecipientsContractProperties', + model_properties: { + emails: { + required: false, + serialized_name: 'emails', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + users: { + required: false, + serialized_name: 'users', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/region_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/region_contract.rb new file mode 100644 index 0000000000..22244e2d88 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/region_contract.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Region profile. + # + class RegionContract + + include MsRestAzure + + # @return [String] Region name. + attr_accessor :name + + # @return [Boolean] whether Region is the master region. + attr_accessor :is_master_region + + # @return [Boolean] whether Region is deleted. + attr_accessor :is_deleted + + + # + # Mapper for RegionContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegionContract', + type: { + name: 'Composite', + class_name: 'RegionContract', + model_properties: { + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + is_master_region: { + required: false, + serialized_name: 'isMasterRegion', + type: { + name: 'Boolean' + } + }, + is_deleted: { + required: false, + serialized_name: 'isDeleted', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/region_list_result.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/region_list_result.rb new file mode 100644 index 0000000000..0aaf90fa0a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/region_list_result.rb @@ -0,0 +1,104 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Lists Regions operation response details. + # + class RegionListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Lists of Regions. + attr_accessor :value + + # @return [Integer] Total record count number across all pages. + attr_accessor :count + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [RegionListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for RegionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegionListResult', + type: { + name: 'Composite', + class_name: 'RegionListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RegionContractElementType', + type: { + name: 'Composite', + class_name: 'RegionContract' + } + } + } + }, + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/registration_delegation_settings_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/registration_delegation_settings_properties.rb new file mode 100644 index 0000000000..506dc170c2 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/registration_delegation_settings_properties.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # User registration delegation settings properties. + # + class RegistrationDelegationSettingsProperties + + include MsRestAzure + + # @return [Boolean] Enable or disable delegation for user registration. + attr_accessor :enabled + + + # + # Mapper for RegistrationDelegationSettingsProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistrationDelegationSettingsProperties', + type: { + name: 'Composite', + class_name: 'RegistrationDelegationSettingsProperties', + model_properties: { + enabled: { + required: false, + serialized_name: 'enabled', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/report_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/report_collection.rb new file mode 100644 index 0000000000..8e30fe99c0 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/report_collection.rb @@ -0,0 +1,104 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Report records list representation. + # + class ReportCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [Integer] Total record count number across all pages. + attr_accessor :count + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ReportCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ReportCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ReportCollection', + type: { + name: 'Composite', + class_name: 'ReportCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ReportRecordContractElementType', + type: { + name: 'Composite', + class_name: 'ReportRecordContract' + } + } + } + }, + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/report_record_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/report_record_contract.rb new file mode 100644 index 0000000000..da598516ff --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/report_record_contract.rb @@ -0,0 +1,311 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Report data. + # + class ReportRecordContract + + include MsRestAzure + + # @return [String] Name depending on report endpoint specifies product, + # API, operation or developer name. + attr_accessor :name + + # @return [DateTime] Start of aggregation period. The date conforms to + # the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + # 8601 standard. + # + attr_accessor :timestamp + + # @return [String] Length of agregation period. Interval must be + # multiple of 15 minutes and may not be zero. The value should be in ISO + # 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + attr_accessor :interval + + # @return [String] Country to which this record data is related. + attr_accessor :country + + # @return [String] Country region to which this record data is related. + attr_accessor :region + + # @return [String] Zip code to which this record data is related. + attr_accessor :zip + + # @return [String] User identifier path. /users/{userId} + attr_accessor :user_id + + # @return [String] Product identifier path. /products/{productId} + attr_accessor :product_id + + # @return [String] API identifier path. /apis/{apiId} + attr_accessor :api_id + + # @return [String] Operation identifier path. + # /apis/{apiId}/operations/{operationId} + attr_accessor :operation_id + + # @return [String] API region identifier. + attr_accessor :api_region + + # @return [String] Subscription identifier path. + # /subscriptions/{subscriptionId} + attr_accessor :subscription_id + + # @return [Integer] Number of succesful calls. This includes calls + # returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and + # HttpStatusCode.TemporaryRedirect + attr_accessor :call_count_success + + # @return [Integer] Number of calls blocked due to invalid credentials. + # This includes calls returning HttpStatusCode.Unauthorize and + # HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests + attr_accessor :call_count_blocked + + # @return [Integer] Number of calls failed due to proxy or backend + # errors. This includes calls returning HttpStatusCode.BadRequest(400) + # and any Code between HttpStatusCode.InternalServerError (500) and 600 + attr_accessor :call_count_failed + + # @return [Integer] Number of other calls. + attr_accessor :call_count_other + + # @return [Integer] Total number of calls. + attr_accessor :call_count_total + + # @return [Integer] Bandwidth consumed. + attr_accessor :bandwidth + + # @return [Integer] Number of times when content was served from cache + # policy. + attr_accessor :cache_hit_count + + # @return [Integer] Number of times content was fetched from backend. + attr_accessor :cache_miss_count + + # @return [Float] Average time it took to process request. + attr_accessor :api_time_avg + + # @return [Float] Minimum time it took to process request. + attr_accessor :api_time_min + + # @return [Float] Maximum time it took to process request. + attr_accessor :api_time_max + + # @return [Float] Average time it took to process request on backend. + attr_accessor :service_time_avg + + # @return [Float] Minimum time it took to process request on backend. + attr_accessor :service_time_min + + # @return [Float] Maximum time it took to process request on backend. + attr_accessor :service_time_max + + + # + # Mapper for ReportRecordContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ReportRecordContract', + type: { + name: 'Composite', + class_name: 'ReportRecordContract', + model_properties: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + timestamp: { + required: false, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + interval: { + required: false, + serialized_name: 'interval', + type: { + name: 'String' + } + }, + country: { + required: false, + serialized_name: 'country', + type: { + name: 'String' + } + }, + region: { + required: false, + serialized_name: 'region', + type: { + name: 'String' + } + }, + zip: { + required: false, + serialized_name: 'zip', + type: { + name: 'String' + } + }, + user_id: { + required: false, + read_only: true, + serialized_name: 'userId', + type: { + name: 'String' + } + }, + product_id: { + required: false, + read_only: true, + serialized_name: 'productId', + type: { + name: 'String' + } + }, + api_id: { + required: false, + serialized_name: 'apiId', + type: { + name: 'String' + } + }, + operation_id: { + required: false, + serialized_name: 'operationId', + type: { + name: 'String' + } + }, + api_region: { + required: false, + serialized_name: 'apiRegion', + type: { + name: 'String' + } + }, + subscription_id: { + required: false, + serialized_name: 'subscriptionId', + type: { + name: 'String' + } + }, + call_count_success: { + required: false, + serialized_name: 'callCountSuccess', + type: { + name: 'Number' + } + }, + call_count_blocked: { + required: false, + serialized_name: 'callCountBlocked', + type: { + name: 'Number' + } + }, + call_count_failed: { + required: false, + serialized_name: 'callCountFailed', + type: { + name: 'Number' + } + }, + call_count_other: { + required: false, + serialized_name: 'callCountOther', + type: { + name: 'Number' + } + }, + call_count_total: { + required: false, + serialized_name: 'callCountTotal', + type: { + name: 'Number' + } + }, + bandwidth: { + required: false, + serialized_name: 'bandwidth', + type: { + name: 'Number' + } + }, + cache_hit_count: { + required: false, + serialized_name: 'cacheHitCount', + type: { + name: 'Number' + } + }, + cache_miss_count: { + required: false, + serialized_name: 'cacheMissCount', + type: { + name: 'Number' + } + }, + api_time_avg: { + required: false, + serialized_name: 'apiTimeAvg', + type: { + name: 'Double' + } + }, + api_time_min: { + required: false, + serialized_name: 'apiTimeMin', + type: { + name: 'Double' + } + }, + api_time_max: { + required: false, + serialized_name: 'apiTimeMax', + type: { + name: 'Double' + } + }, + service_time_avg: { + required: false, + serialized_name: 'serviceTimeAvg', + type: { + name: 'Double' + } + }, + service_time_min: { + required: false, + serialized_name: 'serviceTimeMin', + type: { + name: 'Double' + } + }, + service_time_max: { + required: false, + serialized_name: 'serviceTimeMax', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/representation_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/representation_contract.rb new file mode 100644 index 0000000000..9e0ce31e70 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/representation_contract.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Operation request/response representation details. + # + class RepresentationContract + + include MsRestAzure + + # @return [String] Specifies a registered or custom content type for this + # representation, e.g. application/xml. + attr_accessor :content_type + + # @return [String] An example of the representation. + attr_accessor :sample + + # @return [String] Schema identifier. Applicable only if 'contentType' + # value is neither 'application/x-www-form-urlencoded' nor + # 'multipart/form-data'. + attr_accessor :schema_id + + # @return [String] Type name defined by the schema. Applicable only if + # 'contentType' value is neither 'application/x-www-form-urlencoded' nor + # 'multipart/form-data'. + attr_accessor :type_name + + # @return [Array] Collection of form parameters. + # Required if 'contentType' value is either + # 'application/x-www-form-urlencoded' or 'multipart/form-data'.. + attr_accessor :form_parameters + + + # + # Mapper for RepresentationContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RepresentationContract', + type: { + name: 'Composite', + class_name: 'RepresentationContract', + model_properties: { + content_type: { + required: true, + serialized_name: 'contentType', + type: { + name: 'String' + } + }, + sample: { + required: false, + serialized_name: 'sample', + type: { + name: 'String' + } + }, + schema_id: { + required: false, + serialized_name: 'schemaId', + type: { + name: 'String' + } + }, + type_name: { + required: false, + serialized_name: 'typeName', + type: { + name: 'String' + } + }, + form_parameters: { + required: false, + serialized_name: 'formParameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ParameterContractElementType', + type: { + name: 'Composite', + class_name: 'ParameterContract' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_contract.rb new file mode 100644 index 0000000000..65f2d8c2c4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_contract.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Operation request details. + # + class RequestContract + + include MsRestAzure + + # @return [String] Operation request description. + attr_accessor :description + + # @return [Array] Collection of operation request + # query parameters. + attr_accessor :query_parameters + + # @return [Array] Collection of operation request + # headers. + attr_accessor :headers + + # @return [Array] Collection of operation request + # representations. + attr_accessor :representations + + + # + # Mapper for RequestContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RequestContract', + type: { + name: 'Composite', + class_name: 'RequestContract', + model_properties: { + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + query_parameters: { + required: false, + serialized_name: 'queryParameters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ParameterContractElementType', + type: { + name: 'Composite', + class_name: 'ParameterContract' + } + } + } + }, + headers: { + required: false, + serialized_name: 'headers', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ParameterContractElementType', + type: { + name: 'Composite', + class_name: 'ParameterContract' + } + } + } + }, + representations: { + required: false, + serialized_name: 'representations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RepresentationContractElementType', + type: { + name: 'Composite', + class_name: 'RepresentationContract' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_report_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_report_collection.rb new file mode 100644 index 0000000000..429439f7e3 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_report_collection.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Report records list representation. + # + class RequestReportCollection + + include MsRestAzure + + # @return [Array] Page values. + attr_accessor :value + + # @return [Integer] Total record count number across all pages. + attr_accessor :count + + + # + # Mapper for RequestReportCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RequestReportCollection', + type: { + name: 'Composite', + class_name: 'RequestReportCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RequestReportRecordContractElementType', + type: { + name: 'Composite', + class_name: 'RequestReportRecordContract' + } + } + } + }, + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_report_record_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_report_record_contract.rb new file mode 100644 index 0000000000..7447d7cfe6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/request_report_record_contract.rb @@ -0,0 +1,226 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Request Report data. + # + class RequestReportRecordContract + + include MsRestAzure + + # @return [String] API identifier path. /apis/{apiId} + attr_accessor :api_id + + # @return [String] Operation identifier path. + # /apis/{apiId}/operations/{operationId} + attr_accessor :operation_id + + # @return [String] Product identifier path. /products/{productId} + attr_accessor :product_id + + # @return [String] User identifier path. /users/{userId} + attr_accessor :user_id + + # @return [String] The HTTP method associated with this request.. + attr_accessor :method + + # @return [String] The full URL associated with this request. + attr_accessor :url + + # @return [String] The client IP address associated with this request. + attr_accessor :ip_address + + # @return [String] The HTTP status code received by the gateway as a + # result of forwarding this request to the backend. + attr_accessor :backend_response_code + + # @return [Integer] The HTTP status code returned by the gateway. + attr_accessor :response_code + + # @return [Integer] The size of the response returned by the gateway. + attr_accessor :response_size + + # @return [DateTime] The date and time when this request was received by + # the gateway in ISO 8601 format. + attr_accessor :timestamp + + # @return [String] Specifies if response cache was involved in generating + # the response. If the value is none, the cache was not used. If the + # value is hit, cached response was returned. If the value is miss, the + # cache was used but lookup resulted in a miss and request was fullfilled + # by the backend. + attr_accessor :cache + + # @return [Float] The total time it took to process this request. + attr_accessor :api_time + + # @return [Float] he time it took to forward this request to the backend + # and get the response back. + attr_accessor :service_time + + # @return [String] Azure region where the gateway that processed this + # request is located. + attr_accessor :api_region + + # @return [String] Subscription identifier path. + # /subscriptions/{subscriptionId} + attr_accessor :subscription_id + + # @return [String] Request Identifier. + attr_accessor :request_id + + # @return [Integer] The size of this request.. + attr_accessor :request_size + + + # + # Mapper for RequestReportRecordContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RequestReportRecordContract', + type: { + name: 'Composite', + class_name: 'RequestReportRecordContract', + model_properties: { + api_id: { + required: false, + serialized_name: 'apiId', + type: { + name: 'String' + } + }, + operation_id: { + required: false, + serialized_name: 'operationId', + type: { + name: 'String' + } + }, + product_id: { + required: false, + read_only: true, + serialized_name: 'productId', + type: { + name: 'String' + } + }, + user_id: { + required: false, + read_only: true, + serialized_name: 'userId', + type: { + name: 'String' + } + }, + method: { + required: false, + serialized_name: 'method', + type: { + name: 'String' + } + }, + url: { + required: false, + serialized_name: 'url', + type: { + name: 'String' + } + }, + ip_address: { + required: false, + serialized_name: 'ipAddress', + type: { + name: 'String' + } + }, + backend_response_code: { + required: false, + serialized_name: 'backendResponseCode', + type: { + name: 'String' + } + }, + response_code: { + required: false, + serialized_name: 'responseCode', + type: { + name: 'Number' + } + }, + response_size: { + required: false, + serialized_name: 'responseSize', + type: { + name: 'Number' + } + }, + timestamp: { + required: false, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + cache: { + required: false, + serialized_name: 'cache', + type: { + name: 'String' + } + }, + api_time: { + required: false, + serialized_name: 'apiTime', + type: { + name: 'Double' + } + }, + service_time: { + required: false, + serialized_name: 'serviceTime', + type: { + name: 'Double' + } + }, + api_region: { + required: false, + serialized_name: 'apiRegion', + type: { + name: 'String' + } + }, + subscription_id: { + required: false, + serialized_name: 'subscriptionId', + type: { + name: 'String' + } + }, + request_id: { + required: false, + serialized_name: 'requestId', + type: { + name: 'String' + } + }, + request_size: { + required: false, + serialized_name: 'requestSize', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/resource.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/resource.rb new file mode 100644 index 0000000000..14518126ec --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/resource.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # The Resource definition. + # + class Resource + + include MsRestAzure + + # @return [String] Resource ID. + attr_accessor :id + + # @return [String] Resource name. + attr_accessor :name + + # @return [String] Resource type for API Management resource. + attr_accessor :type + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/response_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/response_contract.rb new file mode 100644 index 0000000000..e3aa211c5c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/response_contract.rb @@ -0,0 +1,92 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Operation response details. + # + class ResponseContract + + include MsRestAzure + + # @return [Integer] Operation response HTTP status code. + attr_accessor :status_code + + # @return [String] Operation response description. + attr_accessor :description + + # @return [Array] Collection of operation + # response representations. + attr_accessor :representations + + # @return [Array] Collection of operation response + # headers. + attr_accessor :headers + + + # + # Mapper for ResponseContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResponseContract', + type: { + name: 'Composite', + class_name: 'ResponseContract', + model_properties: { + status_code: { + required: true, + serialized_name: 'statusCode', + type: { + name: 'Number' + } + }, + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + representations: { + required: false, + serialized_name: 'representations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RepresentationContractElementType', + type: { + name: 'Composite', + class_name: 'RepresentationContract' + } + } + } + }, + headers: { + required: false, + serialized_name: 'headers', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ParameterContractElementType', + type: { + name: 'Composite', + class_name: 'ParameterContract' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb new file mode 100644 index 0000000000..0796f9df36 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/save_configuration_parameter.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Save Tenant Configuration operation. + # + class SaveConfigurationParameter + + include MsRestAzure + + # @return [String] The name of the Git branch in which to commit the + # current configuration snapshot. + attr_accessor :branch + + # @return [Boolean] The value if true, the current configuration database + # is committed to the Git repository, even if the Git repository has + # newer changes that would be overwritten. + attr_accessor :force + + + # + # Mapper for SaveConfigurationParameter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SaveConfigurationParameter', + type: { + name: 'Composite', + class_name: 'SaveConfigurationParameter', + model_properties: { + branch: { + required: true, + serialized_name: 'branch', + type: { + name: 'String' + } + }, + force: { + required: false, + serialized_name: 'force', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/schema_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/schema_collection.rb new file mode 100644 index 0000000000..954ea6f8a9 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/schema_collection.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # The response of the list schema operation. + # + class SchemaCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Api Schema Contract value. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [SchemaCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for SchemaCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SchemaCollection', + type: { + name: 'Composite', + class_name: 'SchemaCollection', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'SchemaContractElementType', + type: { + name: 'Composite', + class_name: 'SchemaContract' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/schema_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/schema_contract.rb new file mode 100644 index 0000000000..add8269098 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/schema_contract.rb @@ -0,0 +1,81 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Schema Contract details. + # + class SchemaContract < Resource + + include MsRestAzure + + # @return [String] Must be a valid a media type used in a Content-Type + # header as defined in the RFC 2616. Media type of the schema document + # (e.g. application/json, application/xml). + attr_accessor :content_type + + # @return [String] Json escaped string defining the document representing + # the Schema. + attr_accessor :value + + + # + # Mapper for SchemaContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SchemaContract', + type: { + name: 'Composite', + class_name: 'SchemaContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + content_type: { + required: true, + serialized_name: 'properties.contentType', + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'properties.document.value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/sku_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/sku_type.rb new file mode 100644 index 0000000000..d6f53fd8f7 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/sku_type.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for SkuType + # + module SkuType + Developer = "Developer" + Standard = "Standard" + Premium = "Premium" + Basic = "Basic" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/soap_api_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/soap_api_type.rb new file mode 100644 index 0000000000..affa74dc0a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/soap_api_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for SoapApiType + # + module SoapApiType + SoapToRest = "http" + SoapPassThrough = "soap" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/state.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/state.rb new file mode 100644 index 0000000000..2c46c301bb --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/state.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for State + # + module State + Proposed = "proposed" + Open = "open" + Removed = "removed" + Resolved = "resolved" + Closed = "closed" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_collection.rb new file mode 100644 index 0000000000..b0de4dd604 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Subscriptions list representation. + # + class SubscriptionCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [SubscriptionCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for SubscriptionCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SubscriptionCollection', + type: { + name: 'Composite', + class_name: 'SubscriptionCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'SubscriptionContractElementType', + type: { + name: 'Composite', + class_name: 'SubscriptionContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_contract.rb new file mode 100644 index 0000000000..2b26ee2af7 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_contract.rb @@ -0,0 +1,228 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Subscription details. + # + class SubscriptionContract < Resource + + include MsRestAzure + + # @return [String] The user resource identifier of the subscription + # owner. The value is a valid relative URL in the format of /users/{uid} + # where {uid} is a user identifier. + attr_accessor :user_id + + # @return [String] The product resource identifier of the subscribed + # product. The value is a valid relative URL in the format of + # /products/{productId} where {productId} is a product identifier. + attr_accessor :product_id + + # @return [String] The name of the subscription, or null if the + # subscription has no name. + attr_accessor :display_name + + # @return [SubscriptionState] Subscription state. Possible states are * + # active – the subscription is active, * suspended – the subscription is + # blocked, and the subscriber cannot call any APIs of the product, * + # submitted – the subscription request has been made by the developer, + # but has not yet been approved or rejected, * rejected – the + # subscription request has been denied by an administrator, * cancelled – + # the subscription has been cancelled by the developer or administrator, + # * expired – the subscription reached its expiration date and was + # deactivated. Possible values include: 'suspended', 'active', 'expired', + # 'submitted', 'rejected', 'cancelled' + attr_accessor :state + + # @return [DateTime] Subscription creation date. The date conforms to the + # following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + # standard. + # + attr_accessor :created_date + + # @return [DateTime] Subscription activation date. The setting is for + # audit purposes only and the subscription is not automatically + # activated. The subscription lifecycle can be managed by using the + # `state` property. The date conforms to the following format: + # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + # + attr_accessor :start_date + + # @return [DateTime] Subscription expiration date. The setting is for + # audit purposes only and the subscription is not automatically expired. + # The subscription lifecycle can be managed by using the `state` + # property. The date conforms to the following format: + # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + # + attr_accessor :expiration_date + + # @return [DateTime] Date when subscription was cancelled or expired. The + # setting is for audit purposes only and the subscription is not + # automatically cancelled. The subscription lifecycle can be managed by + # using the `state` property. The date conforms to the following format: + # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + # + attr_accessor :end_date + + # @return [DateTime] Upcoming subscription expiration notification date. + # The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + # specified by the ISO 8601 standard. + # + attr_accessor :notification_date + + # @return [String] Subscription primary key. + attr_accessor :primary_key + + # @return [String] Subscription secondary key. + attr_accessor :secondary_key + + # @return [String] Optional subscription comment added by an + # administrator. + attr_accessor :state_comment + + + # + # Mapper for SubscriptionContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SubscriptionContract', + type: { + name: 'Composite', + class_name: 'SubscriptionContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + user_id: { + required: true, + serialized_name: 'properties.userId', + type: { + name: 'String' + } + }, + product_id: { + required: true, + serialized_name: 'properties.productId', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 100, + MinLength: 0 + }, + type: { + name: 'String' + } + }, + state: { + required: true, + serialized_name: 'properties.state', + type: { + name: 'Enum', + module: 'SubscriptionState' + } + }, + created_date: { + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + start_date: { + required: false, + serialized_name: 'properties.startDate', + type: { + name: 'DateTime' + } + }, + expiration_date: { + required: false, + serialized_name: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + end_date: { + required: false, + serialized_name: 'properties.endDate', + type: { + name: 'DateTime' + } + }, + notification_date: { + required: false, + serialized_name: 'properties.notificationDate', + type: { + name: 'DateTime' + } + }, + primary_key: { + required: true, + serialized_name: 'properties.primaryKey', + constraints: { + MaxLength: 256, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + secondary_key: { + required: true, + serialized_name: 'properties.secondaryKey', + constraints: { + MaxLength: 256, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + state_comment: { + required: false, + serialized_name: 'properties.stateComment', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb new file mode 100644 index 0000000000..9560f58d49 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_create_parameters.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Subscription create details. + # + class SubscriptionCreateParameters + + include MsRestAzure + + # @return [String] User (user id path) for whom subscription is being + # created in form /users/{uid} + attr_accessor :user_id + + # @return [String] Product (product id path) for which subscription is + # being created in form /products/{productid} + attr_accessor :product_id + + # @return [String] Subscription name. + attr_accessor :display_name + + # @return [String] Primary subscription key. If not specified during + # request key will be generated automatically. + attr_accessor :primary_key + + # @return [String] Secondary subscription key. If not specified during + # request key will be generated automatically. + attr_accessor :secondary_key + + # @return [SubscriptionState] Initial subscription state. If no value is + # specified, subscription is created with Submitted state. Possible + # states are * active – the subscription is active, * suspended – the + # subscription is blocked, and the subscriber cannot call any APIs of the + # product, * submitted – the subscription request has been made by the + # developer, but has not yet been approved or rejected, * rejected – the + # subscription request has been denied by an administrator, * cancelled – + # the subscription has been cancelled by the developer or administrator, + # * expired – the subscription reached its expiration date and was + # deactivated. Possible values include: 'suspended', 'active', 'expired', + # 'submitted', 'rejected', 'cancelled' + attr_accessor :state + + + # + # Mapper for SubscriptionCreateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SubscriptionCreateParameters', + type: { + name: 'Composite', + class_name: 'SubscriptionCreateParameters', + model_properties: { + user_id: { + required: true, + serialized_name: 'properties.userId', + type: { + name: 'String' + } + }, + product_id: { + required: true, + serialized_name: 'properties.productId', + type: { + name: 'String' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + primary_key: { + required: false, + serialized_name: 'properties.primaryKey', + constraints: { + MaxLength: 256, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + secondary_key: { + required: false, + serialized_name: 'properties.secondaryKey', + constraints: { + MaxLength: 256, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + state: { + required: false, + serialized_name: 'properties.state', + type: { + name: 'Enum', + module: 'SubscriptionState' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb new file mode 100644 index 0000000000..95422e01ca --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_key_parameter_names_contract.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Subscription key parameter names details. + # + class SubscriptionKeyParameterNamesContract + + include MsRestAzure + + # @return [String] Subscription key header name. + attr_accessor :header + + # @return [String] Subscription key query string parameter name. + attr_accessor :query + + + # + # Mapper for SubscriptionKeyParameterNamesContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SubscriptionKeyParameterNamesContract', + type: { + name: 'Composite', + class_name: 'SubscriptionKeyParameterNamesContract', + model_properties: { + header: { + required: false, + serialized_name: 'header', + type: { + name: 'String' + } + }, + query: { + required: false, + serialized_name: 'query', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_state.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_state.rb new file mode 100644 index 0000000000..c406f3bd17 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for SubscriptionState + # + module SubscriptionState + Suspended = "suspended" + Active = "active" + Expired = "expired" + Submitted = "submitted" + Rejected = "rejected" + Cancelled = "cancelled" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb new file mode 100644 index 0000000000..3cb1e6853f --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscription_update_parameters.rb @@ -0,0 +1,137 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Subscription update details. + # + class SubscriptionUpdateParameters + + include MsRestAzure + + # @return [String] User identifier path: /users/{uid} + attr_accessor :user_id + + # @return [String] Product identifier path: /products/{productId} + attr_accessor :product_id + + # @return [DateTime] Subscription expiration date. The setting is for + # audit purposes only and the subscription is not automatically expired. + # The subscription lifecycle can be managed by using the `state` + # property. The date conforms to the following format: + # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + attr_accessor :expiration_date + + # @return [String] Subscription name. + attr_accessor :display_name + + # @return [String] Primary subscription key. + attr_accessor :primary_key + + # @return [String] Secondary subscription key. + attr_accessor :secondary_key + + # @return [SubscriptionState] Subscription state. Possible states are * + # active – the subscription is active, * suspended – the subscription is + # blocked, and the subscriber cannot call any APIs of the product, * + # submitted – the subscription request has been made by the developer, + # but has not yet been approved or rejected, * rejected – the + # subscription request has been denied by an administrator, * cancelled – + # the subscription has been cancelled by the developer or administrator, + # * expired – the subscription reached its expiration date and was + # deactivated. Possible values include: 'suspended', 'active', 'expired', + # 'submitted', 'rejected', 'cancelled' + attr_accessor :state + + # @return [String] Comments describing subscription state change by the + # administrator. + attr_accessor :state_comment + + + # + # Mapper for SubscriptionUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SubscriptionUpdateParameters', + type: { + name: 'Composite', + class_name: 'SubscriptionUpdateParameters', + model_properties: { + user_id: { + required: false, + serialized_name: 'properties.userId', + type: { + name: 'String' + } + }, + product_id: { + required: false, + serialized_name: 'properties.productId', + type: { + name: 'String' + } + }, + expiration_date: { + required: false, + serialized_name: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + primary_key: { + required: false, + serialized_name: 'properties.primaryKey', + constraints: { + MaxLength: 256, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + secondary_key: { + required: false, + serialized_name: 'properties.secondaryKey', + constraints: { + MaxLength: 256, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + state: { + required: false, + serialized_name: 'properties.state', + type: { + name: 'Enum', + module: 'SubscriptionState' + } + }, + state_comment: { + required: false, + serialized_name: 'properties.stateComment', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscriptions_delegation_settings_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscriptions_delegation_settings_properties.rb new file mode 100644 index 0000000000..9d5f0ab2e5 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/subscriptions_delegation_settings_properties.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Subscriptions delegation settings properties. + # + class SubscriptionsDelegationSettingsProperties + + include MsRestAzure + + # @return [Boolean] Enable or disable delegation for subscriptions. + attr_accessor :enabled + + + # + # Mapper for SubscriptionsDelegationSettingsProperties class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SubscriptionsDelegationSettingsProperties', + type: { + name: 'Composite', + class_name: 'SubscriptionsDelegationSettingsProperties', + model_properties: { + enabled: { + required: false, + serialized_name: 'enabled', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_collection.rb new file mode 100644 index 0000000000..e0cff8cd09 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Tag list representation. + # + class TagCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [TagCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for TagCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagCollection', + type: { + name: 'Composite', + class_name: 'TagCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'TagContractElementType', + type: { + name: 'Composite', + class_name: 'TagContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_contract.rb new file mode 100644 index 0000000000..97c972b80b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_contract.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Tag Contract details. + # + class TagContract < Resource + + include MsRestAzure + + # @return [String] Tag name. + attr_accessor :display_name + + + # + # Mapper for TagContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagContract', + type: { + name: 'Composite', + class_name: 'TagContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 160, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_create_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_create_update_parameters.rb new file mode 100644 index 0000000000..ae49014735 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_create_update_parameters.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to Create/Update Tag operations. + # + class TagCreateUpdateParameters + + include MsRestAzure + + # @return [String] Tag name. + attr_accessor :display_name + + + # + # Mapper for TagCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'TagCreateUpdateParameters', + model_properties: { + display_name: { + required: true, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 160, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_collection.rb new file mode 100644 index 0000000000..8f5654062c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged TagDescription list representation. + # + class TagDescriptionCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [TagDescriptionCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for TagDescriptionCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagDescriptionCollection', + type: { + name: 'Composite', + class_name: 'TagDescriptionCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'TagDescriptionContractElementType', + type: { + name: 'Composite', + class_name: 'TagDescriptionContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_contract.rb new file mode 100644 index 0000000000..cbea7509c5 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_contract.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Contract details. + # + class TagDescriptionContract < Resource + + include MsRestAzure + + # @return [String] Description of the Tag. + attr_accessor :description + + # @return [String] Absolute URL of external resources describing the tag. + attr_accessor :external_docs_url + + # @return [String] Description of the external resources describing the + # tag. + attr_accessor :external_docs_description + + # @return [String] Tag name. + attr_accessor :display_name + + + # + # Mapper for TagDescriptionContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagDescriptionContract', + type: { + name: 'Composite', + class_name: 'TagDescriptionContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + external_docs_url: { + required: false, + serialized_name: 'properties.externalDocsUrl', + constraints: { + MaxLength: 2000 + }, + type: { + name: 'String' + } + }, + external_docs_description: { + required: false, + serialized_name: 'properties.externalDocsDescription', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + constraints: { + MaxLength: 160, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_create_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_create_parameters.rb new file mode 100644 index 0000000000..6c02fac247 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_description_create_parameters.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Create TagDescription operation. + # + class TagDescriptionCreateParameters + + include MsRestAzure + + # @return [String] Description of the Tag. + attr_accessor :description + + # @return [String] Absolute URL of external resources describing the tag. + attr_accessor :external_docs_url + + # @return [String] Description of the external resources describing the + # tag. + attr_accessor :external_docs_description + + + # + # Mapper for TagDescriptionCreateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagDescriptionCreateParameters', + type: { + name: 'Composite', + class_name: 'TagDescriptionCreateParameters', + model_properties: { + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + external_docs_url: { + required: false, + serialized_name: 'properties.externalDocsUrl', + constraints: { + MaxLength: 2000 + }, + type: { + name: 'String' + } + }, + external_docs_description: { + required: false, + serialized_name: 'properties.externalDocsDescription', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_resource_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_resource_collection.rb new file mode 100644 index 0000000000..2da0f24471 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_resource_collection.rb @@ -0,0 +1,104 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Tag list representation. + # + class TagResourceCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [Integer] Total record count number across all pages. + attr_accessor :count + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [TagResourceCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for TagResourceCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagResourceCollection', + type: { + name: 'Composite', + class_name: 'TagResourceCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'TagResourceContractElementType', + type: { + name: 'Composite', + class_name: 'TagResourceContract' + } + } + } + }, + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_resource_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_resource_contract.rb new file mode 100644 index 0000000000..3e6e981762 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_resource_contract.rb @@ -0,0 +1,81 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # TagResource contract properties. + # + class TagResourceContract + + include MsRestAzure + + # @return [TagTagResourceContractProperties] Tag associated with the + # resource. + attr_accessor :tag + + # @return [ApiTagResourceContractProperties] Api associated with the tag. + attr_accessor :api + + # @return [OperationTagResourceContractProperties] Operation associated + # with the tag. + attr_accessor :operation + + # @return [ProductTagResourceContractProperties] Product associated with + # the tag. + attr_accessor :product + + + # + # Mapper for TagResourceContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagResourceContract', + type: { + name: 'Composite', + class_name: 'TagResourceContract', + model_properties: { + tag: { + required: true, + serialized_name: 'tag', + type: { + name: 'Composite', + class_name: 'TagTagResourceContractProperties' + } + }, + api: { + required: false, + serialized_name: 'api', + type: { + name: 'Composite', + class_name: 'ApiTagResourceContractProperties' + } + }, + operation: { + required: false, + serialized_name: 'operation', + type: { + name: 'Composite', + class_name: 'OperationTagResourceContractProperties' + } + }, + product: { + required: false, + serialized_name: 'product', + type: { + name: 'Composite', + class_name: 'ProductTagResourceContractProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_tag_resource_contract_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_tag_resource_contract_properties.rb new file mode 100644 index 0000000000..ec10306a00 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tag_tag_resource_contract_properties.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Contract defining the Tag property in the Tag Resource Contract + # + class TagTagResourceContractProperties + + include MsRestAzure + + # @return [String] Tag identifier + attr_accessor :id + + # @return [String] Tag Name + attr_accessor :name + + + # + # Mapper for TagTagResourceContractProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TagTagResourceContractProperties', + type: { + name: 'Composite', + class_name: 'TagTagResourceContractProperties', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serialized_name: 'name', + constraints: { + MaxLength: 160, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/template_name.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/template_name.rb new file mode 100644 index 0000000000..af6f9c9a63 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/template_name.rb @@ -0,0 +1,28 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for TemplateName + # + module TemplateName + ApplicationApprovedNotificationMessage = "applicationApprovedNotificationMessage" + AccountClosedDeveloper = "accountClosedDeveloper" + QuotaLimitApproachingDeveloperNotificationMessage = "quotaLimitApproachingDeveloperNotificationMessage" + NewDeveloperNotificationMessage = "newDeveloperNotificationMessage" + EmailChangeIdentityDefault = "emailChangeIdentityDefault" + InviteUserNotificationMessage = "inviteUserNotificationMessage" + NewCommentNotificationMessage = "newCommentNotificationMessage" + ConfirmSignUpIdentityDefault = "confirmSignUpIdentityDefault" + NewIssueNotificationMessage = "newIssueNotificationMessage" + PurchaseDeveloperNotificationMessage = "purchaseDeveloperNotificationMessage" + PasswordResetIdentityDefault = "passwordResetIdentityDefault" + PasswordResetByAdminNotificationMessage = "passwordResetByAdminNotificationMessage" + RejectDeveloperNotificationMessage = "rejectDeveloperNotificationMessage" + RequestDeveloperNotificationMessage = "requestDeveloperNotificationMessage" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb new file mode 100644 index 0000000000..1d0132ed30 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/tenant_configuration_sync_state_contract.rb @@ -0,0 +1,113 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Tenant Configuration Synchronization State. + # + class TenantConfigurationSyncStateContract + + include MsRestAzure + + # @return [String] The name of Git branch. + attr_accessor :branch + + # @return [String] The latest commit Id. + attr_accessor :commit_id + + # @return [Boolean] value indicating if last sync was save (true) or + # deploy (false) operation. + attr_accessor :is_export + + # @return [Boolean] value indicating if last synchronization was later + # than the configuration change. + attr_accessor :is_synced + + # @return [Boolean] value indicating whether Git configuration access is + # enabled. + attr_accessor :is_git_enabled + + # @return [DateTime] The date of the latest synchronization. The date + # conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + # by the ISO 8601 standard. + # + attr_accessor :sync_date + + # @return [DateTime] The date of the latest configuration change. The + # date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + # specified by the ISO 8601 standard. + # + attr_accessor :configuration_change_date + + + # + # Mapper for TenantConfigurationSyncStateContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TenantConfigurationSyncStateContract', + type: { + name: 'Composite', + class_name: 'TenantConfigurationSyncStateContract', + model_properties: { + branch: { + required: false, + serialized_name: 'branch', + type: { + name: 'String' + } + }, + commit_id: { + required: false, + serialized_name: 'commitId', + type: { + name: 'String' + } + }, + is_export: { + required: false, + serialized_name: 'isExport', + type: { + name: 'Boolean' + } + }, + is_synced: { + required: false, + serialized_name: 'isSynced', + type: { + name: 'Boolean' + } + }, + is_git_enabled: { + required: false, + serialized_name: 'isGitEnabled', + type: { + name: 'Boolean' + } + }, + sync_date: { + required: false, + serialized_name: 'syncDate', + type: { + name: 'DateTime' + } + }, + configuration_change_date: { + required: false, + serialized_name: 'configurationChangeDate', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/terms_of_service_properties.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/terms_of_service_properties.rb new file mode 100644 index 0000000000..056d42ccc2 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/terms_of_service_properties.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Terms of service contract properties. + # + class TermsOfServiceProperties + + include MsRestAzure + + # @return [String] A terms of service text. + attr_accessor :text + + # @return [Boolean] Display terms of service during a sign-up process. + attr_accessor :enabled + + # @return [Boolean] Ask user for consent to the terms of service. + attr_accessor :consent_required + + + # + # Mapper for TermsOfServiceProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TermsOfServiceProperties', + type: { + name: 'Composite', + class_name: 'TermsOfServiceProperties', + model_properties: { + text: { + required: false, + serialized_name: 'text', + type: { + name: 'String' + } + }, + enabled: { + required: false, + serialized_name: 'enabled', + type: { + name: 'Boolean' + } + }, + consent_required: { + required: false, + serialized_name: 'consentRequired', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb new file mode 100644 index 0000000000..a446f20628 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/token_body_parameter_contract.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # OAuth acquire token request body parameter (www-url-form-encoded). + # + class TokenBodyParameterContract + + include MsRestAzure + + # @return [String] body parameter name. + attr_accessor :name + + # @return [String] body parameter value. + attr_accessor :value + + + # + # Mapper for TokenBodyParameterContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TokenBodyParameterContract', + type: { + name: 'Composite', + class_name: 'TokenBodyParameterContract', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + required: true, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_collection.rb new file mode 100644 index 0000000000..48f0165f4d --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_collection.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Paged Users list representation. + # + class UserCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Page values. + attr_accessor :value + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [UserCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for UserCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserCollection', + type: { + name: 'Composite', + class_name: 'UserCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UserContractElementType', + type: { + name: 'Composite', + class_name: 'UserContract' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_contract.rb new file mode 100644 index 0000000000..3a8473120c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_contract.rb @@ -0,0 +1,165 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # User details. + # + class UserContract < Resource + + include MsRestAzure + + # @return [UserState] Account state. Specifies whether the user is active + # or not. Blocked users are unable to sign into the developer portal or + # call any APIs of subscribed products. Default state is Active. Possible + # values include: 'active', 'blocked', 'pending', 'deleted'. Default + # value: 'active' . + attr_accessor :state + + # @return [String] Optional note about a user set by the administrator. + attr_accessor :note + + # @return [Array] Collection of user identities. + attr_accessor :identities + + # @return [String] First name. + attr_accessor :first_name + + # @return [String] Last name. + attr_accessor :last_name + + # @return [String] Email address. + attr_accessor :email + + # @return [DateTime] Date of user registration. The date conforms to the + # following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + # standard. + # + attr_accessor :registration_date + + # @return [Array] Collection of groups user is + # part of. + attr_accessor :groups + + + # + # Mapper for UserContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserContract', + type: { + name: 'Composite', + class_name: 'UserContract', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + state: { + required: false, + serialized_name: 'properties.state', + default_value: 'active', + type: { + name: 'String' + } + }, + note: { + required: false, + serialized_name: 'properties.note', + type: { + name: 'String' + } + }, + identities: { + required: false, + read_only: true, + serialized_name: 'properties.identities', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UserIdentityContractElementType', + type: { + name: 'Composite', + class_name: 'UserIdentityContract' + } + } + } + }, + first_name: { + required: false, + serialized_name: 'properties.firstName', + type: { + name: 'String' + } + }, + last_name: { + required: false, + serialized_name: 'properties.lastName', + type: { + name: 'String' + } + }, + email: { + required: false, + serialized_name: 'properties.email', + type: { + name: 'String' + } + }, + registration_date: { + required: false, + serialized_name: 'properties.registrationDate', + type: { + name: 'DateTime' + } + }, + groups: { + required: false, + read_only: true, + serialized_name: 'properties.groups', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'GroupContractPropertiesElementType', + type: { + name: 'Composite', + class_name: 'GroupContractProperties' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_create_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_create_parameters.rb new file mode 100644 index 0000000000..5208790cd3 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_create_parameters.rb @@ -0,0 +1,144 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # User create details. + # + class UserCreateParameters + + include MsRestAzure + + # @return [UserState] Account state. Specifies whether the user is active + # or not. Blocked users are unable to sign into the developer portal or + # call any APIs of subscribed products. Default state is Active. Possible + # values include: 'active', 'blocked', 'pending', 'deleted'. Default + # value: 'active' . + attr_accessor :state + + # @return [String] Optional note about a user set by the administrator. + attr_accessor :note + + # @return [Array] Collection of user identities. + attr_accessor :identities + + # @return [String] Email address. Must not be empty and must be unique + # within the service instance. + attr_accessor :email + + # @return [String] First name. + attr_accessor :first_name + + # @return [String] Last name. + attr_accessor :last_name + + # @return [String] User Password. If no value is provided, a default + # password is generated. + attr_accessor :password + + # @return [Confirmation] Determines the type of confirmation e-mail that + # will be sent to the newly created user. Possible values include: + # 'signup', 'invite' + attr_accessor :confirmation + + + # + # Mapper for UserCreateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserCreateParameters', + type: { + name: 'Composite', + class_name: 'UserCreateParameters', + model_properties: { + state: { + required: false, + serialized_name: 'properties.state', + default_value: 'active', + type: { + name: 'String' + } + }, + note: { + required: false, + serialized_name: 'properties.note', + type: { + name: 'String' + } + }, + identities: { + required: false, + read_only: true, + serialized_name: 'properties.identities', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UserIdentityContractElementType', + type: { + name: 'Composite', + class_name: 'UserIdentityContract' + } + } + } + }, + email: { + required: true, + serialized_name: 'properties.email', + constraints: { + MaxLength: 254, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + first_name: { + required: true, + serialized_name: 'properties.firstName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + last_name: { + required: true, + serialized_name: 'properties.lastName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + password: { + required: false, + serialized_name: 'properties.password', + type: { + name: 'String' + } + }, + confirmation: { + required: false, + serialized_name: 'properties.confirmation', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_entity_base_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_entity_base_parameters.rb new file mode 100644 index 0000000000..db6f755ad0 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_entity_base_parameters.rb @@ -0,0 +1,78 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # User Entity Base Parameters set. + # + class UserEntityBaseParameters + + include MsRestAzure + + # @return [UserState] Account state. Specifies whether the user is active + # or not. Blocked users are unable to sign into the developer portal or + # call any APIs of subscribed products. Default state is Active. Possible + # values include: 'active', 'blocked', 'pending', 'deleted'. Default + # value: 'active' . + attr_accessor :state + + # @return [String] Optional note about a user set by the administrator. + attr_accessor :note + + # @return [Array] Collection of user identities. + attr_accessor :identities + + + # + # Mapper for UserEntityBaseParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserEntityBaseParameters', + type: { + name: 'Composite', + class_name: 'UserEntityBaseParameters', + model_properties: { + state: { + required: false, + serialized_name: 'state', + default_value: 'active', + type: { + name: 'String' + } + }, + note: { + required: false, + serialized_name: 'note', + type: { + name: 'String' + } + }, + identities: { + required: false, + read_only: true, + serialized_name: 'identities', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UserIdentityContractElementType', + type: { + name: 'Composite', + class_name: 'UserIdentityContract' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_identity_collection.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_identity_collection.rb new file mode 100644 index 0000000000..233c86b922 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_identity_collection.rb @@ -0,0 +1,104 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # List of Users Identity list representation. + # + class UserIdentityCollection + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] User Identity values. + attr_accessor :value + + # @return [Integer] Total record count number across all pages. + attr_accessor :count + + # @return [String] Next page link if any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [UserIdentityCollection] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for UserIdentityCollection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserIdentityCollection', + type: { + name: 'Composite', + class_name: 'UserIdentityCollection', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UserIdentityContractElementType', + type: { + name: 'Composite', + class_name: 'UserIdentityContract' + } + } + } + }, + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_identity_contract.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_identity_contract.rb new file mode 100644 index 0000000000..f256e54465 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_identity_contract.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # User identity details. + # + class UserIdentityContract + + include MsRestAzure + + # @return [String] Identity provider name. + attr_accessor :provider + + # @return [String] Identifier value within provider. + attr_accessor :id + + + # + # Mapper for UserIdentityContract class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserIdentityContract', + type: { + name: 'Composite', + class_name: 'UserIdentityContract', + model_properties: { + provider: { + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_state.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_state.rb new file mode 100644 index 0000000000..25f4c3f04f --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_state.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for UserState + # + module UserState + Active = "active" + Blocked = "blocked" + Pending = "pending" + Deleted = "deleted" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_token_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_token_parameters.rb new file mode 100644 index 0000000000..7be0c8836a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_token_parameters.rb @@ -0,0 +1,61 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Parameters supplied to the Get User Token operation. + # + class UserTokenParameters + + include MsRestAzure + + # @return [KeyType] The Key to be used to generate token for user. + # Possible values include: 'primary', 'secondary'. Default value: + # 'primary' . + attr_accessor :key_type + + # @return [DateTime] The Expiry time of the Token. Maximum token expiry + # time is set to 30 days. The date conforms to the following format: + # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + # + attr_accessor :expiry + + + # + # Mapper for UserTokenParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserTokenParameters', + type: { + name: 'Composite', + class_name: 'UserTokenParameters', + model_properties: { + key_type: { + required: true, + serialized_name: 'keyType', + default_value: 'primary', + type: { + name: 'Enum', + module: 'KeyType' + } + }, + expiry: { + required: true, + serialized_name: 'expiry', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_token_result.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_token_result.rb new file mode 100644 index 0000000000..1008e294aa --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_token_result.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Get User Token response details. + # + class UserTokenResult + + include MsRestAzure + + # @return [String] Shared Access Authorization token for the User. + attr_accessor :value + + + # + # Mapper for UserTokenResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserTokenResult', + type: { + name: 'Composite', + class_name: 'UserTokenResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_update_parameters.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_update_parameters.rb new file mode 100644 index 0000000000..87825d2ccf --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/user_update_parameters.rb @@ -0,0 +1,131 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # User update parameters. + # + class UserUpdateParameters + + include MsRestAzure + + # @return [UserState] Account state. Specifies whether the user is active + # or not. Blocked users are unable to sign into the developer portal or + # call any APIs of subscribed products. Default state is Active. Possible + # values include: 'active', 'blocked', 'pending', 'deleted'. Default + # value: 'active' . + attr_accessor :state + + # @return [String] Optional note about a user set by the administrator. + attr_accessor :note + + # @return [Array] Collection of user identities. + attr_accessor :identities + + # @return [String] Email address. Must not be empty and must be unique + # within the service instance. + attr_accessor :email + + # @return [String] User Password. + attr_accessor :password + + # @return [String] First name. + attr_accessor :first_name + + # @return [String] Last name. + attr_accessor :last_name + + + # + # Mapper for UserUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UserUpdateParameters', + type: { + name: 'Composite', + class_name: 'UserUpdateParameters', + model_properties: { + state: { + required: false, + serialized_name: 'properties.state', + default_value: 'active', + type: { + name: 'String' + } + }, + note: { + required: false, + serialized_name: 'properties.note', + type: { + name: 'String' + } + }, + identities: { + required: false, + read_only: true, + serialized_name: 'properties.identities', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UserIdentityContractElementType', + type: { + name: 'Composite', + class_name: 'UserIdentityContract' + } + } + } + }, + email: { + required: false, + serialized_name: 'properties.email', + constraints: { + MaxLength: 254, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + password: { + required: false, + serialized_name: 'properties.password', + type: { + name: 'String' + } + }, + first_name: { + required: false, + serialized_name: 'properties.firstName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + }, + last_name: { + required: false, + serialized_name: 'properties.lastName', + constraints: { + MaxLength: 100, + MinLength: 1 + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/versioning_scheme.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/versioning_scheme.rb new file mode 100644 index 0000000000..29c47369d8 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/versioning_scheme.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for VersioningScheme + # + module VersioningScheme + Segment = "Segment" + Query = "Query" + Header = "Header" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb new file mode 100644 index 0000000000..9e441a2336 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/virtual_network_configuration.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Configuration of a virtual network to which API Management service is + # deployed. + # + class VirtualNetworkConfiguration + + include MsRestAzure + + # @return [String] The virtual network ID. This is typically a GUID. + # Expect a null GUID by default. + attr_accessor :vnetid + + # @return [String] The name of the subnet. + attr_accessor :subnetname + + # @return [String] The full resource ID of a subnet in a virtual network + # to deploy the API Management service in. + attr_accessor :subnet_resource_id + + + # + # Mapper for VirtualNetworkConfiguration class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'VirtualNetworkConfiguration', + type: { + name: 'Composite', + class_name: 'VirtualNetworkConfiguration', + model_properties: { + vnetid: { + required: false, + read_only: true, + serialized_name: 'vnetid', + type: { + name: 'String' + } + }, + subnetname: { + required: false, + read_only: true, + serialized_name: 'subnetname', + type: { + name: 'String' + } + }, + subnet_resource_id: { + required: false, + serialized_name: 'subnetResourceId', + constraints: { + Pattern: '^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$' + }, + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/virtual_network_type.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/virtual_network_type.rb new file mode 100644 index 0000000000..9fedb56f67 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/virtual_network_type.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Defines values for VirtualNetworkType + # + module VirtualNetworkType + None = "None" + External = "External" + Internal = "Internal" + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/x509certificate_name.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/x509certificate_name.rb new file mode 100644 index 0000000000..aadfc5dd86 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/models/x509certificate_name.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + module Models + # + # Properties of server X509Names. + # + class X509CertificateName + + include MsRestAzure + + # @return [String] Common Name of the Certificate. + attr_accessor :name + + # @return [String] Thumbprint for the Issuer of the Certificate. + attr_accessor :issuer_certificate_thumbprint + + + # + # Mapper for X509CertificateName class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'X509CertificateName', + type: { + name: 'Composite', + class_name: 'X509CertificateName', + model_properties: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + issuer_certificate_thumbprint: { + required: false, + serialized_name: 'issuerCertificateThumbprint', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/module_definition.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/module_definition.rb new file mode 100644 index 0000000000..d0a58ba7dc --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::ApiManagement end +module Azure::ApiManagement::Mgmt end +module Azure::ApiManagement::Mgmt::V2018_01_01_preview end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/network_status.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/network_status.rb new file mode 100644 index 0000000000..816acceb57 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/network_status.rb @@ -0,0 +1,243 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class NetworkStatus + include MsRestAzure + + # + # Creates and initializes a new instance of the NetworkStatus class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the Connectivity Status to the external resources on which the Api + # Management service depends from inside the Cloud Service. This also returns + # the DNS Servers as visible to the CloudService. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Connectivity Status to the external resources on which the Api + # Management service depends from inside the Cloud Service. This also returns + # the DNS Servers as visible to the CloudService. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets the Connectivity Status to the external resources on which the Api + # Management service depends from inside the Cloud Service. This also returns + # the DNS Servers as visible to the CloudService. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def list_by_service_async(resource_group_name, service_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, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/networkstatus' + + 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,'serviceName' => service_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = { + required: false, + serialized_name: 'parsed_response', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'NetworkStatusContractByLocationElementType', + type: { + name: 'Composite', + class_name: 'NetworkStatusContractByLocation' + } + } + } + } + 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 + + # + # Gets the Connectivity Status to the external resources on which the Api + # Management service depends from inside the Cloud Service. This also returns + # the DNS Servers as visible to the CloudService. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param location_name [String] Location in which the API Management service is + # deployed. This is one of the Azure Regions like West US, East US, South + # Central US. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NetworkStatusContract] operation results. + # + def list_by_location(resource_group_name, service_name, location_name, custom_headers = nil) + response = list_by_location_async(resource_group_name, service_name, location_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Connectivity Status to the external resources on which the Api + # Management service depends from inside the Cloud Service. This also returns + # the DNS Servers as visible to the CloudService. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param location_name [String] Location in which the API Management service is + # deployed. This is one of the Azure Regions like West US, East US, South + # Central US. + # @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. + # + def list_by_location_with_http_info(resource_group_name, service_name, location_name, custom_headers = nil) + list_by_location_async(resource_group_name, service_name, location_name, custom_headers).value! + end + + # + # Gets the Connectivity Status to the external resources on which the Api + # Management service depends from inside the Cloud Service. This also returns + # the DNS Servers as visible to the CloudService. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param location_name [String] Location in which the API Management service is + # deployed. This is one of the Azure Regions like West US, East US, South + # Central US. + # @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. + # + def list_by_location_async(resource_group_name, service_name, location_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, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'location_name is nil' if location_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus' + + 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,'serviceName' => service_name,'locationName' => location_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::NetworkStatusContract.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 + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification.rb new file mode 100644 index 0000000000..bcb11edbc5 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification.rb @@ -0,0 +1,454 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Notification + include MsRestAzure + + # + # Creates and initializes a new instance of the Notification class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, top, skip, custom_headers).value! + end + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::NotificationCollection.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 + + # + # Gets the details of the Notification specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotificationContract] operation results. + # + def get(resource_group_name, service_name, notification_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, notification_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the Notification specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @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. + # + def get_with_http_info(resource_group_name, service_name, notification_name, custom_headers = nil) + get_async(resource_group_name, service_name, notification_name, custom_headers).value! + end + + # + # Gets the details of the Notification specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @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. + # + def get_async(resource_group_name, service_name, notification_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::NotificationContract.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 + + # + # Updates an Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotificationContract] operation results. + # + def create_or_update(resource_group_name, service_name, notification_name, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, notification_name, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates an Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, notification_name, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, notification_name, if_match, custom_headers).value! + end + + # + # Updates an Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, notification_name, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_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(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::NotificationContract.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 + + # + # Lists a collection of properties defined within a service instance. + # + # @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 [NotificationCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of properties defined within a service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of properties defined within a service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::NotificationCollection.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 + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotificationCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb new file mode 100644 index 0000000000..2974b71010 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb @@ -0,0 +1,458 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class NotificationRecipientEmail + include MsRestAzure + + # + # Creates and initializes a new instance of the NotificationRecipientEmail class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the list of the Notification Recipient Emails subscribed to a + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RecipientEmailCollection] operation results. + # + def list_by_notification(resource_group_name, service_name, notification_name, custom_headers = nil) + response = list_by_notification_async(resource_group_name, service_name, notification_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the list of the Notification Recipient Emails subscribed to a + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @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. + # + def list_by_notification_with_http_info(resource_group_name, service_name, notification_name, custom_headers = nil) + list_by_notification_async(resource_group_name, service_name, notification_name, custom_headers).value! + end + + # + # Gets the list of the Notification Recipient Emails subscribed to a + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @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. + # + def list_by_notification_async(resource_group_name, service_name, notification_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RecipientEmailCollection.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 + + # + # Determine if Notification Recipient Email subscribed to the notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_entity_exists(resource_group_name, service_name, notification_name, email, custom_headers = nil) + response = check_entity_exists_async(resource_group_name, service_name, notification_name, email, custom_headers).value! + response.body unless response.nil? + end + + # + # Determine if Notification Recipient Email subscribed to the notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def check_entity_exists_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers = nil) + check_entity_exists_async(resource_group_name, service_name, notification_name, email, custom_headers).value! + end + + # + # Determine if Notification Recipient Email subscribed to the notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def check_entity_exists_async(resource_group_name, service_name, notification_name, email, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, 'email is nil' if email.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_name,'email' => email,'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(:head, 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 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 204) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Adds the Email address to the list of Recipients for the Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RecipientEmailContract] operation results. + # + def create_or_update(resource_group_name, service_name, notification_name, email, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, notification_name, email, custom_headers).value! + response.body unless response.nil? + end + + # + # Adds the Email address to the list of Recipients for the Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def create_or_update_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, notification_name, email, custom_headers).value! + end + + # + # Adds the Email address to the list of Recipients for the Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def create_or_update_async(resource_group_name, service_name, notification_name, email, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, 'email is nil' if email.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_name,'email' => email,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RecipientEmailContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RecipientEmailContract.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 + + # + # Removes the email from the list of Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, notification_name, email, custom_headers = nil) + response = delete_async(resource_group_name, service_name, notification_name, email, custom_headers).value! + nil + end + + # + # Removes the email from the list of Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers = nil) + delete_async(resource_group_name, service_name, notification_name, email, custom_headers).value! + end + + # + # Removes the email from the list of Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param email [String] Email identifier. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(resource_group_name, service_name, notification_name, email, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, 'email is nil' if email.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_name,'email' => email,'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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_user.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_user.rb new file mode 100644 index 0000000000..ee353dae08 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_user.rb @@ -0,0 +1,470 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class NotificationRecipientUser + include MsRestAzure + + # + # Creates and initializes a new instance of the NotificationRecipientUser class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the list of the Notification Recipient User subscribed to the + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RecipientUserCollection] operation results. + # + def list_by_notification(resource_group_name, service_name, notification_name, custom_headers = nil) + response = list_by_notification_async(resource_group_name, service_name, notification_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the list of the Notification Recipient User subscribed to the + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @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. + # + def list_by_notification_with_http_info(resource_group_name, service_name, notification_name, custom_headers = nil) + list_by_notification_async(resource_group_name, service_name, notification_name, custom_headers).value! + end + + # + # Gets the list of the Notification Recipient User subscribed to the + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @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. + # + def list_by_notification_async(resource_group_name, service_name, notification_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RecipientUserCollection.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 + + # + # Determine if the Notification Recipient User is subscribed to the + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_entity_exists(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + response = check_entity_exists_async(resource_group_name, service_name, notification_name, uid, custom_headers).value! + response.body unless response.nil? + end + + # + # Determine if the Notification Recipient User is subscribed to the + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def check_entity_exists_with_http_info(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + check_entity_exists_async(resource_group_name, service_name, notification_name, uid, custom_headers).value! + end + + # + # Determine if the Notification Recipient User is subscribed to the + # notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def check_entity_exists_async(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_name,'uid' => uid,'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(:head, 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 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 204) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Adds the API Management User to the list of Recipients for the Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RecipientUserContract] operation results. + # + def create_or_update(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, notification_name, uid, custom_headers).value! + response.body unless response.nil? + end + + # + # Adds the API Management User to the list of Recipients for the Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, notification_name, uid, custom_headers).value! + end + + # + # Adds the API Management User to the list of Recipients for the Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def create_or_update_async(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_name,'uid' => uid,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RecipientUserContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RecipientUserContract.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 + + # + # Removes the API Management user from the list of Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + response = delete_async(resource_group_name, service_name, notification_name, uid, custom_headers).value! + nil + end + + # + # Removes the API Management user from the list of Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + delete_async(resource_group_name, service_name, notification_name, uid, custom_headers).value! + end + + # + # Removes the API Management user from the list of Notification. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param notification_name [NotificationName] Notification Name Identifier. + # Possible values include: 'RequestPublisherNotificationMessage', + # 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', + # 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', + # 'QuotaLimitApproachingPublisherNotificationMessage' + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def delete_async(resource_group_name, service_name, notification_name, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'notification_name is nil' if notification_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'notificationName' => notification_name,'uid' => uid,'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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/open_id_connect_provider.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/open_id_connect_provider.rb new file mode 100644 index 0000000000..0f1fa295ae --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/open_id_connect_provider.rb @@ -0,0 +1,774 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class OpenIdConnectProvider + include MsRestAzure + + # + # Creates and initializes a new instance of the OpenIdConnectProvider class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all OpenID Connect Providers. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all OpenID Connect Providers. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists all OpenID Connect Providers. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/openidConnectProviders' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OpenIdConnectProviderCollection.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 + + # + # Gets the entity state (Etag) version of the openIdConnectProvider specified + # by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, opid, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, opid, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the openIdConnectProvider specified + # by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, opid, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, opid, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the openIdConnectProvider specified + # by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, opid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'opid is nil' if opid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'opid' => opid,'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(:head, 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 + end + + promise.execute + end + + # + # Gets specific OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OpenidConnectProviderContract] operation results. + # + def get(resource_group_name, service_name, opid, custom_headers = nil) + response = get_async(resource_group_name, service_name, opid, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets specific OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @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. + # + def get_with_http_info(resource_group_name, service_name, opid, custom_headers = nil) + get_async(resource_group_name, service_name, opid, custom_headers).value! + end + + # + # Gets specific OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @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. + # + def get_async(resource_group_name, service_name, opid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'opid is nil' if opid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'opid' => opid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OpenidConnectProviderContract.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 + + # + # Creates or updates the OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param parameters [OpenidConnectProviderContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OpenidConnectProviderContract] operation results. + # + def create_or_update(resource_group_name, service_name, opid, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates the OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param parameters [OpenidConnectProviderContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, opid, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers).value! + end + + # + # Creates or updates the OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param parameters [OpenidConnectProviderContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, opid, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'opid is nil' if opid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OpenidConnectProviderContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'opid' => opid,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OpenidConnectProviderContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OpenidConnectProviderContract.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 + + # + # Updates the specific OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param parameters [OpenidConnectProviderUpdateContract] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the specific OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param parameters [OpenidConnectProviderUpdateContract] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers).value! + end + + # + # Updates the specific OpenID Connect Provider. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param parameters [OpenidConnectProviderUpdateContract] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, opid, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'opid is nil' if opid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OpenidConnectProviderUpdateContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'opid' => opid,'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 == 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 + end + + promise.execute + end + + # + # Deletes specific OpenID Connect Provider of the API Management service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, opid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, opid, if_match, custom_headers).value! + nil + end + + # + # Deletes specific OpenID Connect Provider of the API Management service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, opid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, opid, if_match, custom_headers).value! + end + + # + # Deletes specific OpenID Connect Provider of the API Management service + # instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param opid [String] Identifier of the OpenID Connect Provider. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, opid, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'opid is nil' if opid.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'opid' => opid,'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 + end + + promise.execute + end + + # + # Lists all OpenID Connect Providers. + # + # @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 [OpenIdConnectProviderCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all OpenID Connect Providers. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all OpenID Connect Providers. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OpenIdConnectProviderCollection.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 + + # + # Lists all OpenID Connect Providers. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OpenIdConnectProviderCollection] which provide lazy access to pages + # of the response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/operation_operations.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/operation_operations.rb new file mode 100644 index 0000000000..b2c91a6d96 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/operation_operations.rb @@ -0,0 +1,306 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class OperationOperations + include MsRestAzure + + # + # Creates and initializes a new instance of the OperationOperations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of operations associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_tags(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_tags_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of operations associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_tags_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_tags_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of operations associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_tags_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagResourceCollection.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 + + # + # Lists a collection of operations associated with tags. + # + # @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 [TagResourceCollection] operation results. + # + def list_by_tags_next(next_page_link, custom_headers = nil) + response = list_by_tags_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of operations associated with tags. + # + # @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. + # + def list_by_tags_next_with_http_info(next_page_link, custom_headers = nil) + list_by_tags_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of operations associated with tags. + # + # @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. + # + def list_by_tags_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagResourceCollection.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 + + # + # Lists a collection of operations associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagResourceCollection] which provide lazy access to pages of the + # response. + # + def list_by_tags_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_tags_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_tags_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/policy.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/policy.rb new file mode 100644 index 0000000000..567aa030a6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/policy.rb @@ -0,0 +1,508 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Policy + include MsRestAzure + + # + # Creates and initializes a new instance of the Policy class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all the Global Policy definitions of the Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param scope [PolicyScopeContract] Policy scope. Possible values include: + # 'Tenant', 'Product', 'Api', 'Operation', 'All' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyCollection] operation results. + # + def list_by_service(resource_group_name, service_name, scope = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, scope, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the Global Policy definitions of the Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param scope [PolicyScopeContract] Policy scope. Possible values include: + # 'Tenant', 'Product', 'Api', 'Operation', 'All' + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, scope = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, scope, custom_headers).value! + end + + # + # Lists all the Global Policy definitions of the Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param scope [PolicyScopeContract] Policy scope. Possible values include: + # 'Tenant', 'Product', 'Api', 'Operation', 'All' + # @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. + # + def list_by_service_async(resource_group_name, service_name, scope = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/policies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'scope' => scope,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyCollection.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 + + # + # Gets the entity state (Etag) version of the Global policy definition in the + # Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the Global policy definition in the + # Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the Global policy definition in the + # Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + policy_id = 'policy' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'policyId' => policy_id,'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(:head, 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 + end + + promise.execute + end + + # + # Get the Global policy definition of the Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyContract] operation results. + # + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the Global policy definition of the Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Get the Global policy definition of the Api Management service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + policy_id = 'policy' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'policyId' => policy_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.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 + + # + # Creates or updates the global policy configuration of the Api Management + # service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PolicyContract] The policy contents to apply. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyContract] operation results. + # + def create_or_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates the global policy configuration of the Api Management + # service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PolicyContract] The policy contents to apply. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Creates or updates the global policy configuration of the Api Management + # service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PolicyContract] The policy contents to apply. + # @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. + # + def create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + policy_id = 'policy' + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'policyId' => policy_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.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 + + # + # Deletes the global policy configuration of the Api Management Service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, if_match, custom_headers).value! + nil + end + + # + # Deletes the global policy configuration of the Api Management Service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, if_match, custom_headers).value! + end + + # + # Deletes the global policy configuration of the Api Management Service. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + policy_id = 'policy' + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'policyId' => policy_id,'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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/policy_snippets.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/policy_snippets.rb new file mode 100644 index 0000000000..d19ebb4641 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/policy_snippets.rb @@ -0,0 +1,122 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class PolicySnippets + include MsRestAzure + + # + # Creates and initializes a new instance of the PolicySnippets class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all policy snippets. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param scope [PolicyScopeContract] Policy scope. Possible values include: + # 'Tenant', 'Product', 'Api', 'Operation', 'All' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicySnippetsCollection] operation results. + # + def list_by_service(resource_group_name, service_name, scope = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, scope, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all policy snippets. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param scope [PolicyScopeContract] Policy scope. Possible values include: + # 'Tenant', 'Product', 'Api', 'Operation', 'All' + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, scope = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, scope, custom_headers).value! + end + + # + # Lists all policy snippets. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param scope [PolicyScopeContract] Policy scope. Possible values include: + # 'Tenant', 'Product', 'Api', 'Operation', 'All' + # @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. + # + def list_by_service_async(resource_group_name, service_name, scope = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/policySnippets' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'scope' => scope,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicySnippetsCollection.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 + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product.rb new file mode 100644 index 0000000000..14e54ac639 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product.rb @@ -0,0 +1,824 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Product + include MsRestAzure + + # + # Creates and initializes a new instance of the Product class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of products in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param expand_groups [Boolean] When set to true, the response contains an + # array of groups that have visibility to the product. The default is false. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of products in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param expand_groups [Boolean] When set to true, the response contains an + # array of groups that have visibility to the product. The default is false. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers).value! + end + + # + # Lists a collection of products in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param expand_groups [Boolean] When set to true, the response contains an + # array of groups that have visibility to the product. The default is false. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'expandGroups' => expand_groups,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductCollection.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 + + # + # Gets the entity state (Etag) version of the product specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, product_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, product_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the product specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, product_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, product_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the product specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, product_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the product specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ProductContract] operation results. + # + def get(resource_group_name, service_name, product_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, product_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the product specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, product_id, custom_headers = nil) + get_async(resource_group_name, service_name, product_id, custom_headers).value! + end + + # + # Gets the details of the product specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, product_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductContract.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 + + # + # Creates or Updates a product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [ProductContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ProductContract] operation results. + # + def create_or_update(resource_group_name, service_name, product_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or Updates a product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [ProductContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or Updates a product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [ProductContract] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductContract.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 product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [ProductUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Update product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [ProductUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! + end + + # + # Update product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [ProductUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'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 == 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 + end + + promise.execute + end + + # + # Delete product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_subscriptions [Boolean] Delete existing subscriptions + # associated with the product or not. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions, custom_headers).value! + nil + end + + # + # Delete product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_subscriptions [Boolean] Delete existing subscriptions + # associated with the product or not. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions, custom_headers).value! + end + + # + # Delete product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_subscriptions [Boolean] Delete existing subscriptions + # associated with the product or not. + # @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. + # + def delete_async(resource_group_name, service_name, product_id, if_match, delete_subscriptions = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'subscriptionId' => @client.subscription_id}, + query_params: {'deleteSubscriptions' => delete_subscriptions,'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 + end + + promise.execute + end + + # + # Lists a collection of products in the specified service instance. + # + # @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 [ProductCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of products in the specified service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of products in the specified service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ProductCollection.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 + + # + # Lists a collection of products in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param expand_groups [Boolean] When set to true, the response contains an + # array of groups that have visibility to the product. The default is false. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ProductCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, expand_groups = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, expand_groups, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_api.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_api.rb new file mode 100644 index 0000000000..11d19cb4d1 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_api.rb @@ -0,0 +1,614 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ProductApi + include MsRestAzure + + # + # Creates and initializes a new instance of the ProductApi class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of the APIs associated with a product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_product(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of the APIs associated with a product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of the APIs associated with a product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_product_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/apis' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiCollection.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 + + # + # Checks that API entity specified by identifier is associated with the Product + # entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_entity_exists(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + response = check_entity_exists_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Checks that API entity specified by identifier is associated with the Product + # entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def check_entity_exists_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + check_entity_exists_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! + end + + # + # Checks that API entity specified by identifier is associated with the Product + # entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def check_entity_exists_async(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'apiId' => api_id,'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(:head, 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 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 204) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Adds an API to the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiContract] operation results. + # + def create_or_update(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Adds an API to the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! + end + + # + # Adds an API to the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def create_or_update_async(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'apiId' => api_id,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiContract.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 + + # + # Deletes the specified API from the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! + nil + end + + # + # Deletes the specified API from the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, api_id, custom_headers).value! + end + + # + # Deletes the specified API from the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @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. + # + def delete_async(resource_group_name, service_name, product_id, api_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'apiId' => api_id,'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 + end + + promise.execute + end + + # + # Lists a collection of the APIs associated with a product. + # + # @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 [ApiCollection] operation results. + # + def list_by_product_next(next_page_link, custom_headers = nil) + response = list_by_product_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of the APIs associated with a product. + # + # @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. + # + def list_by_product_next_with_http_info(next_page_link, custom_headers = nil) + list_by_product_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of the APIs associated with a product. + # + # @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. + # + def list_by_product_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ApiCollection.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 + + # + # Lists a collection of the APIs associated with a product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApiCollection] which provide lazy access to pages of the response. + # + def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_product_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_group.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_group.rb new file mode 100644 index 0000000000..7051f85323 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_group.rb @@ -0,0 +1,603 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ProductGroup + include MsRestAzure + + # + # Creates and initializes a new instance of the ProductGroup class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists the collection of developer groups associated with the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq, ne | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_product(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists the collection of developer groups associated with the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq, ne | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! + end + + # + # Lists the collection of developer groups associated with the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq, ne | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_product_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/groups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupCollection.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 + + # + # Checks that Group entity specified by identifier is associated with the + # Product entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_entity_exists(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + response = check_entity_exists_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Checks that Group entity specified by identifier is associated with the + # Product entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def check_entity_exists_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + check_entity_exists_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! + end + + # + # Checks that Group entity specified by identifier is associated with the + # Product entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def check_entity_exists_async(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'groupId' => group_id,'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(:head, 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 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 204) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Adds the association between the specified developer group with the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GroupContract] operation results. + # + def create_or_update(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Adds the association between the specified developer group with the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! + end + + # + # Adds the association between the specified developer group with the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def create_or_update_async(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'groupId' => group_id,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupContract.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 + + # + # Deletes the association between the specified group and product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! + nil + end + + # + # Deletes the association between the specified group and product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, group_id, custom_headers).value! + end + + # + # Deletes the association between the specified group and product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param group_id [String] Group identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def delete_async(resource_group_name, service_name, product_id, group_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'group_id is nil' if group_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'groupId' => group_id,'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 + end + + promise.execute + end + + # + # Lists the collection of developer groups associated with the specified + # product. + # + # @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 [GroupCollection] operation results. + # + def list_by_product_next(next_page_link, custom_headers = nil) + response = list_by_product_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the collection of developer groups associated with the specified + # product. + # + # @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. + # + def list_by_product_next_with_http_info(next_page_link, custom_headers = nil) + list_by_product_next_async(next_page_link, custom_headers).value! + end + + # + # Lists the collection of developer groups associated with the specified + # product. + # + # @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. + # + def list_by_product_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupCollection.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 + + # + # Lists the collection of developer groups associated with the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | type | eq, ne | N/A + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GroupCollection] which provide lazy access to pages of the response. + # + def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_product_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_policy.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_policy.rb new file mode 100644 index 0000000000..8f0de63f7e --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_policy.rb @@ -0,0 +1,538 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ProductPolicy + include MsRestAzure + + # + # Creates and initializes a new instance of the ProductPolicy class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Get the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyCollection] operation results. + # + def list_by_product(resource_group_name, service_name, product_id, custom_headers = nil) + response = list_by_product_async(resource_group_name, service_name, product_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def list_by_product_with_http_info(resource_group_name, service_name, product_id, custom_headers = nil) + list_by_product_async(resource_group_name, service_name, product_id, custom_headers).value! + end + + # + # Get the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def list_by_product_async(resource_group_name, service_name, product_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/policies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'productId' => product_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyCollection.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 the ETag of the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, product_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, product_id, custom_headers).value! + nil + end + + # + # Get the ETag of the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, product_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, product_id, custom_headers).value! + end + + # + # Get the ETag of the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, product_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + policy_id = 'policy' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'productId' => product_id,'policyId' => policy_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:head, 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 + end + + promise.execute + end + + # + # Get the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyContract] operation results. + # + def get(resource_group_name, service_name, product_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, product_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, product_id, custom_headers = nil) + get_async(resource_group_name, service_name, product_id, custom_headers).value! + end + + # + # Get the policy configuration at the Product level. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, product_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + policy_id = 'policy' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'productId' => product_id,'policyId' => policy_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.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 + + # + # Creates or updates policy configuration for the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyContract] operation results. + # + def create_or_update(resource_group_name, service_name, product_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates policy configuration for the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, product_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or updates policy configuration for the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param parameters [PolicyContract] The policy contents to apply. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, product_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + policy_id = 'policy' + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'policyId' => policy_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PolicyContract.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 + + # + # Deletes the policy configuration at the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, product_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, product_id, if_match, custom_headers).value! + nil + end + + # + # Deletes the policy configuration at the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, product_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, product_id, if_match, custom_headers).value! + end + + # + # Deletes the policy configuration at the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, product_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + policy_id = 'policy' + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'policyId' => policy_id,'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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_subscriptions.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_subscriptions.rb new file mode 100644 index 0000000000..67e3592726 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_subscriptions.rb @@ -0,0 +1,302 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class ProductSubscriptions + include MsRestAzure + + # + # Creates and initializes a new instance of the ProductSubscriptions class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists the collection of subscriptions to the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists the collection of subscriptions to the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! + end + + # + # Lists the collection of subscriptions to the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/subscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionCollection.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 + + # + # Lists the collection of subscriptions to the specified product. + # + # @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 [SubscriptionCollection] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the collection of subscriptions to the specified product. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists the collection of subscriptions to the specified product. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionCollection.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 + + # + # Lists the collection of subscriptions to the specified product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SubscriptionCollection] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_async(resource_group_name, service_name, product_id, filter, top, skip, 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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/property.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/property.rb new file mode 100644 index 0000000000..882e883091 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/property.rb @@ -0,0 +1,771 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Property + include MsRestAzure + + # + # Creates and initializes a new instance of the Property class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|-------------------------------------------------------| + # | tags | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith, any, all | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|-------------------------------------------------------| + # | tags | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith, any, all | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|-------------------------------------------------------| + # | tags | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith, any, all | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/properties' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PropertyCollection.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 + + # + # Gets the entity state (Etag) version of the property specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, prop_id, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, prop_id, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the property specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, prop_id, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, prop_id, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the property specified by its + # identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, prop_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'prop_id is nil' if prop_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/properties/{propId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'propId' => prop_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the property specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PropertyContract] operation results. + # + def get(resource_group_name, service_name, prop_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, prop_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the property specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @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. + # + def get_with_http_info(resource_group_name, service_name, prop_id, custom_headers = nil) + get_async(resource_group_name, service_name, prop_id, custom_headers).value! + end + + # + # Gets the details of the property specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @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. + # + def get_async(resource_group_name, service_name, prop_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'prop_id is nil' if prop_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/properties/{propId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'propId' => prop_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PropertyContract.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 + + # + # Creates or updates a property. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param parameters [PropertyContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PropertyContract] operation results. + # + def create_or_update(resource_group_name, service_name, prop_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates a property. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param parameters [PropertyContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, prop_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers).value! + end + + # + # Creates or updates a property. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param parameters [PropertyContract] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, prop_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'prop_id is nil' if prop_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PropertyContract.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'propId' => prop_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PropertyContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PropertyContract.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 + + # + # Updates the specific property. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param parameters [PropertyUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the specific property. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param parameters [PropertyUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the specific property. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param parameters [PropertyUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, prop_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'prop_id is nil' if prop_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PropertyUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'propId' => prop_id,'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 == 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 + end + + promise.execute + end + + # + # Deletes specific property from the the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers).value! + nil + end + + # + # Deletes specific property from the the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers).value! + end + + # + # Deletes specific property from the the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param prop_id [String] Identifier of the property. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, prop_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'prop_id is nil' if prop_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'propId' => prop_id,'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 + end + + promise.execute + end + + # + # Lists a collection of properties defined within a service instance. + # + # @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 [PropertyCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of properties defined within a service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of properties defined within a service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PropertyCollection.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 + + # + # Lists a collection of properties defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported functions + # | + # |-------|------------------------|-------------------------------------------------------| + # | tags | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith, any, all | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PropertyCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/quota_by_counter_keys.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/quota_by_counter_keys.rb new file mode 100644 index 0000000000..5ff97bae9a --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/quota_by_counter_keys.rb @@ -0,0 +1,256 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class QuotaByCounterKeys + include MsRestAzure + + # + # Creates and initializes a new instance of the QuotaByCounterKeys class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of current quota counter periods associated with the + # counter-key configured in the policy on the specified service instance. The + # api does not support paging yet. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [QuotaCounterCollection] operation results. + # + def list_by_service(resource_group_name, service_name, quota_counter_key, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of current quota counter periods associated with the + # counter-key configured in the policy on the specified service instance. The + # api does not support paging yet. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" 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. + # + def list_by_service_with_http_info(resource_group_name, service_name, quota_counter_key, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, quota_counter_key, custom_headers).value! + end + + # + # Lists a collection of current quota counter periods associated with the + # counter-key configured in the policy on the specified service instance. The + # api does not support paging yet. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" 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. + # + def list_by_service_async(resource_group_name, service_name, quota_counter_key, 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, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}' + + 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,'serviceName' => service_name,'quotaCounterKey' => quota_counter_key}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::QuotaCounterCollection.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 + + # + # Updates all the quota counter values specified with the existing quota + # counter key to a value in the specified service instance. This should be used + # for reset of the quota counter values. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param parameters [QuotaCounterValueContractProperties] The value of the + # quota counter to be applied to all quota counter periods. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers).value! + nil + end + + # + # Updates all the quota counter values specified with the existing quota + # counter key to a value in the specified service instance. This should be used + # for reset of the quota counter values. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param parameters [QuotaCounterValueContractProperties] The value of the + # quota counter to be applied to all quota counter periods. + # @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. + # + def update_with_http_info(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) + update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers).value! + end + + # + # Updates all the quota counter values specified with the existing quota + # counter key to a value in the specified service instance. This should be used + # for reset of the quota counter values. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param parameters [QuotaCounterValueContractProperties] The value of the + # quota counter to be applied to all quota counter periods. + # @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. + # + def update_async(resource_group_name, service_name, quota_counter_key, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::QuotaCounterValueContractProperties.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'quotaCounterKey' => quota_counter_key,'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 == 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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/quota_by_period_keys.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/quota_by_period_keys.rb new file mode 100644 index 0000000000..91a8260741 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/quota_by_period_keys.rb @@ -0,0 +1,255 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class QuotaByPeriodKeys + include MsRestAzure + + # + # Creates and initializes a new instance of the QuotaByPeriodKeys class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the value of the quota counter associated with the counter-key in the + # policy for the specific period in service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param quota_period_key [String] Quota period key identifier. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [QuotaCounterContract] operation results. + # + def get(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers = nil) + response = get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the value of the quota counter associated with the counter-key in the + # policy for the specific period in service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param quota_period_key [String] Quota period key identifier. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers = nil) + get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, custom_headers).value! + end + + # + # Gets the value of the quota counter associated with the counter-key in the + # policy for the specific period in service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param quota_period_key [String] Quota period key identifier. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, service_name, quota_counter_key, quota_period_key, 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, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? + fail ArgumentError, 'quota_period_key is nil' if quota_period_key.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}' + + 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,'serviceName' => service_name,'quotaCounterKey' => quota_counter_key,'quotaPeriodKey' => quota_period_key}, + 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::QuotaCounterContract.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 + + # + # Updates an existing quota counter value in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param quota_period_key [String] Quota period key identifier. + # @param parameters [QuotaCounterValueContractProperties] The value of the + # Quota counter to be applied on the specified period. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) + response = update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers).value! + nil + end + + # + # Updates an existing quota counter value in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param quota_period_key [String] Quota period key identifier. + # @param parameters [QuotaCounterValueContractProperties] The value of the + # Quota counter to be applied on the specified period. + # @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. + # + def update_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) + update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers).value! + end + + # + # Updates an existing quota counter value in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param quota_counter_key [String] Quota counter key identifier.This is the + # result of expression defined in counter-key attribute of the quota-by-key + # policy.For Example, if you specify counter-key="boo" in the policy, then it’s + # accessible by "boo" counter key. But if it’s defined as + # counter-key="@("b"+"a")" then it will be accessible by "ba" key + # @param quota_period_key [String] Quota period key identifier. + # @param parameters [QuotaCounterValueContractProperties] The value of the + # Quota counter to be applied on the specified period. + # @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. + # + def update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'quota_counter_key is nil' if quota_counter_key.nil? + fail ArgumentError, 'quota_period_key is nil' if quota_period_key.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::QuotaCounterValueContractProperties.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'quotaCounterKey' => quota_counter_key,'quotaPeriodKey' => quota_period_key,'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 == 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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/regions.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/regions.rb new file mode 100644 index 0000000000..169015b5e9 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/regions.rb @@ -0,0 +1,225 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Regions + include MsRestAzure + + # + # Creates and initializes a new instance of the Regions class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all azure regions in which the service exists. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, custom_headers) + first_page.get_all_items + end + + # + # Lists all azure regions in which the service exists. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Lists all azure regions in which the service exists. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def list_by_service_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/regions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RegionListResult.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 + + # + # Lists all azure regions in which the service exists. + # + # @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 [RegionListResult] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all azure regions in which the service exists. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all azure regions in which the service exists. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RegionListResult.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 + + # + # Lists all azure regions in which the service exists. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegionListResult] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/reports.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/reports.rb new file mode 100644 index 0000000000..d5a2c52abb --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/reports.rb @@ -0,0 +1,1635 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Reports + include MsRestAzure + + # + # Creates and initializes a new instance of the Reports class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists report records by API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_api(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_api_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists report records by API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_api_with_http_info(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + list_by_api_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists report records by API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_api_async(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/reports/byApi' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by User. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_user(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_user_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists report records by User. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_user_with_http_info(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + list_by_user_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists report records by User. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_user_async(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/reports/byUser' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by API Operations. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_operation(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_operation_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists report records by API Operations. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_operation_with_http_info(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + list_by_operation_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists report records by API Operations. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_operation_async(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/reports/byOperation' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_product(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_product_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists report records by Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_product_with_http_info(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + list_by_product_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists report records by Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_product_async(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/reports/byProduct' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by GeoGraphy. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_geo(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_geo_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists report records by GeoGraphy. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_geo_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_geo_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists report records by GeoGraphy. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_geo_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/reports/byGeo' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by subscription. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_subscription(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_subscription_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists report records by subscription. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_subscription_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_subscription_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists report records by subscription. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_subscription_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/reports/bySubscription' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by Time. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param interval [Duration] By time interval. Interval must be multiple of 15 + # minutes and may not be zero. The value should be in ISO 8601 format + # (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + # convert TimeSpan to a valid interval string: XmlConvert.ToString(new + # TimeSpan(hours, minutes, secconds)) + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_time(resource_group_name, service_name, interval, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_time_as_lazy(resource_group_name, service_name, interval, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists report records by Time. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param interval [Duration] By time interval. Interval must be multiple of 15 + # minutes and may not be zero. The value should be in ISO 8601 format + # (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + # convert TimeSpan to a valid interval string: XmlConvert.ToString(new + # TimeSpan(hours, minutes, secconds)) + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_time_with_http_info(resource_group_name, service_name, interval, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_time_async(resource_group_name, service_name, interval, filter, top, skip, custom_headers).value! + end + + # + # Lists report records by Time. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param interval [Duration] By time interval. Interval must be multiple of 15 + # minutes and may not be zero. The value should be in ISO 8601 format + # (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + # convert TimeSpan to a valid interval string: XmlConvert.ToString(new + # TimeSpan(hours, minutes, secconds)) + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_time_async(resource_group_name, service_name, interval, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'interval is nil' if interval.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/reports/byTime' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'interval' => interval,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by Request. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RequestReportCollection] operation results. + # + def list_by_request(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + response = list_by_request_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists report records by Request. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_request_with_http_info(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + list_by_request_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists report records by Request. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_request_async(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/reports/byRequest' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::RequestReportCollection.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 + + # + # Lists report records by API. + # + # @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 [ReportCollection] operation results. + # + def list_by_api_next(next_page_link, custom_headers = nil) + response = list_by_api_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists report records by API. + # + # @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. + # + def list_by_api_next_with_http_info(next_page_link, custom_headers = nil) + list_by_api_next_async(next_page_link, custom_headers).value! + end + + # + # Lists report records by API. + # + # @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. + # + def list_by_api_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by User. + # + # @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 [ReportCollection] operation results. + # + def list_by_user_next(next_page_link, custom_headers = nil) + response = list_by_user_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists report records by User. + # + # @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. + # + def list_by_user_next_with_http_info(next_page_link, custom_headers = nil) + list_by_user_next_async(next_page_link, custom_headers).value! + end + + # + # Lists report records by User. + # + # @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. + # + def list_by_user_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by API Operations. + # + # @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 [ReportCollection] operation results. + # + def list_by_operation_next(next_page_link, custom_headers = nil) + response = list_by_operation_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists report records by API Operations. + # + # @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. + # + def list_by_operation_next_with_http_info(next_page_link, custom_headers = nil) + list_by_operation_next_async(next_page_link, custom_headers).value! + end + + # + # Lists report records by API Operations. + # + # @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. + # + def list_by_operation_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by Product. + # + # @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 [ReportCollection] operation results. + # + def list_by_product_next(next_page_link, custom_headers = nil) + response = list_by_product_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists report records by Product. + # + # @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. + # + def list_by_product_next_with_http_info(next_page_link, custom_headers = nil) + list_by_product_next_async(next_page_link, custom_headers).value! + end + + # + # Lists report records by Product. + # + # @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. + # + def list_by_product_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by GeoGraphy. + # + # @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 [ReportCollection] operation results. + # + def list_by_geo_next(next_page_link, custom_headers = nil) + response = list_by_geo_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists report records by GeoGraphy. + # + # @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. + # + def list_by_geo_next_with_http_info(next_page_link, custom_headers = nil) + list_by_geo_next_async(next_page_link, custom_headers).value! + end + + # + # Lists report records by GeoGraphy. + # + # @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. + # + def list_by_geo_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by 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 [ReportCollection] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers = nil) + response = list_by_subscription_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists report records by 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. + # + def list_by_subscription_next_with_http_info(next_page_link, custom_headers = nil) + list_by_subscription_next_async(next_page_link, custom_headers).value! + end + + # + # Lists report records by 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. + # + def list_by_subscription_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by Time. + # + # @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 [ReportCollection] operation results. + # + def list_by_time_next(next_page_link, custom_headers = nil) + response = list_by_time_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists report records by Time. + # + # @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. + # + def list_by_time_next_with_http_info(next_page_link, custom_headers = nil) + list_by_time_next_async(next_page_link, custom_headers).value! + end + + # + # Lists report records by Time. + # + # @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. + # + def list_by_time_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::ReportCollection.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 + + # + # Lists report records by API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReportCollection] which provide lazy access to pages of the + # response. + # + def list_by_api_as_lazy(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + response = list_by_api_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_api_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists report records by User. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReportCollection] which provide lazy access to pages of the + # response. + # + def list_by_user_as_lazy(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + response = list_by_user_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_user_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists report records by API Operations. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReportCollection] which provide lazy access to pages of the + # response. + # + def list_by_operation_as_lazy(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + response = list_by_operation_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_operation_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists report records by Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReportCollection] which provide lazy access to pages of the + # response. + # + def list_by_product_as_lazy(resource_group_name, service_name, filter, top = nil, skip = nil, custom_headers = nil) + response = list_by_product_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_product_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists report records by GeoGraphy. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReportCollection] which provide lazy access to pages of the + # response. + # + def list_by_geo_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_geo_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_geo_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists report records by subscription. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReportCollection] which provide lazy access to pages of the + # response. + # + def list_by_subscription_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_subscription_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists report records by Time. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param interval [Duration] By time interval. Interval must be multiple of 15 + # minutes and may not be zero. The value should be in ISO 8601 format + # (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + # convert TimeSpan to a valid interval string: XmlConvert.ToString(new + # TimeSpan(hours, minutes, secconds)) + # @param filter [String] The filter to apply on the operation. + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReportCollection] which provide lazy access to pages of the + # response. + # + def list_by_time_as_lazy(resource_group_name, service_name, interval, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_time_async(resource_group_name, service_name, interval, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_time_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/sign_in_settings.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/sign_in_settings.rb new file mode 100644 index 0000000000..0f5db139c4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/sign_in_settings.rb @@ -0,0 +1,404 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class SignInSettings + include MsRestAzure + + # + # Creates and initializes a new instance of the SignInSettings class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the entity state (Etag) version of the SignInSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the SignInSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the SignInSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/portalsettings/signin' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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(:head, 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 + end + + promise.execute + end + + # + # Get Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PortalSigninSettings] operation results. + # + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Get Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/portalsettings/signin' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalSigninSettings.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 Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSigninSettings] Update Sign-In settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! + nil + end + + # + # Update Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSigninSettings] Update Sign-In settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! + end + + # + # Update Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSigninSettings] Update Sign-In settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalSigninSettings.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 == 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 + end + + promise.execute + end + + # + # Create or Update Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSigninSettings] Create or update parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PortalSigninSettings] operation results. + # + def create_or_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Create or Update Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSigninSettings] Create or update 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. + # + def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Create or Update Sign-In settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSigninSettings] Create or update 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. + # + def create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalSigninSettings.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalSigninSettings.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 + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/sign_up_settings.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/sign_up_settings.rb new file mode 100644 index 0000000000..62368124eb --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/sign_up_settings.rb @@ -0,0 +1,404 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class SignUpSettings + include MsRestAzure + + # + # Creates and initializes a new instance of the SignUpSettings class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the entity state (Etag) version of the SignUpSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the SignUpSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the SignUpSettings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/portalsettings/signup' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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(:head, 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 + end + + promise.execute + end + + # + # Get Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PortalSignupSettings] operation results. + # + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Get Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/portalsettings/signup' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalSignupSettings.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 Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSignupSettings] Update Sign-Up settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! + nil + end + + # + # Update Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSignupSettings] Update Sign-Up settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! + end + + # + # Update Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSignupSettings] Update Sign-Up settings. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalSignupSettings.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_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 == 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 + end + + promise.execute + end + + # + # Create or Update Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSignupSettings] Create or update parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PortalSignupSettings] operation results. + # + def create_or_update(resource_group_name, service_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Create or Update Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSignupSettings] Create or update 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. + # + def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # Create or Update Sign-Up settings. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [PortalSignupSettings] Create or update 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. + # + def create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalSignupSettings.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::PortalSignupSettings.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 + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/subscription.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/subscription.rb new file mode 100644 index 0000000000..5da9eeb3f6 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/subscription.rb @@ -0,0 +1,1025 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Subscription + include MsRestAzure + + # + # Creates and initializes a new instance of the Subscription class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all subscriptions of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all subscriptions of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists all subscriptions of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/subscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionCollection.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 + + # + # Gets the entity state (Etag) version of the apimanagement subscription + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, sid, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, sid, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the apimanagement subscription + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, sid, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the apimanagement subscription + # specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, sid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'sid is nil' if sid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/subscriptions/{sid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'sid' => sid,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the specified Subscription entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SubscriptionContract] operation results. + # + def get(resource_group_name, service_name, sid, custom_headers = nil) + response = get_async(resource_group_name, service_name, sid, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the specified Subscription entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @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. + # + def get_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + get_async(resource_group_name, service_name, sid, custom_headers).value! + end + + # + # Gets the specified Subscription entity. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @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. + # + def get_async(resource_group_name, service_name, sid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'sid is nil' if sid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/subscriptions/{sid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'sid' => sid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionContract.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 + + # + # Creates or updates the subscription of specified user to the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param parameters [SubscriptionCreateParameters] Create parameters. + # @param notify [Boolean] Notify change in Subscription State. + # - If false, do not send any email notification for change of state of + # subscription + # - If true, send email notification of change of state of subscription + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SubscriptionContract] operation results. + # + def create_or_update(resource_group_name, service_name, sid, parameters, notify = nil, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, sid, parameters, notify, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates the subscription of specified user to the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param parameters [SubscriptionCreateParameters] Create parameters. + # @param notify [Boolean] Notify change in Subscription State. + # - If false, do not send any email notification for change of state of + # subscription + # - If true, send email notification of change of state of subscription + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, sid, parameters, notify = nil, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, sid, parameters, notify, if_match, custom_headers).value! + end + + # + # Creates or updates the subscription of specified user to the specified + # product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param parameters [SubscriptionCreateParameters] Create parameters. + # @param notify [Boolean] Notify change in Subscription State. + # - If false, do not send any email notification for change of state of + # subscription + # - If true, send email notification of change of state of subscription + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, sid, parameters, notify = nil, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'sid is nil' if sid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionCreateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'sid' => sid,'subscriptionId' => @client.subscription_id}, + query_params: {'notify' => notify,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionContract.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 + + # + # Updates the details of a subscription specificied by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param parameters [SubscriptionUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param notify [Boolean] Notify change in Subscription State. + # - If false, do not send any email notification for change of state of + # subscription + # - If true, send email notification of change of state of subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, sid, parameters, if_match, notify = nil, custom_headers = nil) + response = update_async(resource_group_name, service_name, sid, parameters, if_match, notify, custom_headers).value! + nil + end + + # + # Updates the details of a subscription specificied by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param parameters [SubscriptionUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param notify [Boolean] Notify change in Subscription State. + # - If false, do not send any email notification for change of state of + # subscription + # - If true, send email notification of change of state of 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. + # + def update_with_http_info(resource_group_name, service_name, sid, parameters, if_match, notify = nil, custom_headers = nil) + update_async(resource_group_name, service_name, sid, parameters, if_match, notify, custom_headers).value! + end + + # + # Updates the details of a subscription specificied by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param parameters [SubscriptionUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param notify [Boolean] Notify change in Subscription State. + # - If false, do not send any email notification for change of state of + # subscription + # - If true, send email notification of change of state of 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. + # + def update_async(resource_group_name, service_name, sid, parameters, if_match, notify = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'sid is nil' if sid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'sid' => sid,'subscriptionId' => @client.subscription_id}, + query_params: {'notify' => notify,'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 == 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 + end + + promise.execute + end + + # + # Deletes the specified subscription. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, sid, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, sid, if_match, custom_headers).value! + nil + end + + # + # Deletes the specified subscription. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, sid, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, sid, if_match, custom_headers).value! + end + + # + # Deletes the specified subscription. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, sid, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'sid is nil' if sid.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'sid' => sid,'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 + end + + promise.execute + end + + # + # Regenerates primary key of existing subscription of the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def regenerate_primary_key(resource_group_name, service_name, sid, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers).value! + nil + end + + # + # Regenerates primary key of existing subscription of the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @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. + # + def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers).value! + end + + # + # Regenerates primary key of existing subscription of the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @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. + # + def regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'sid is nil' if sid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'sid' => sid,'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 + end + + promise.execute + end + + # + # Regenerates secondary key of existing subscription of the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def regenerate_secondary_key(resource_group_name, service_name, sid, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers).value! + nil + end + + # + # Regenerates secondary key of existing subscription of the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @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. + # + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, sid, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers).value! + end + + # + # Regenerates secondary key of existing subscription of the API Management + # service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param sid [String] Subscription entity Identifier. The entity represents the + # association between a user and a product in API Management. + # @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. + # + def regenerate_secondary_key_async(resource_group_name, service_name, sid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'sid is nil' if sid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'sid' => sid,'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 + end + + promise.execute + end + + # + # Lists all subscriptions of the API Management service instance. + # + # @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 [SubscriptionCollection] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all subscriptions of the API Management service instance. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all subscriptions of the API Management service instance. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionCollection.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 + + # + # Lists all subscriptions of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SubscriptionCollection] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_async(resource_group_name, service_name, filter, top, skip, 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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb new file mode 100644 index 0000000000..7a9ba744c2 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb @@ -0,0 +1,2878 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class Tag + include MsRestAzure + + # + # Creates and initializes a new instance of the Tag class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of tags defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of tags defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of tags defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tags' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCollection.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 + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_state(resource_group_name, service_name, tag_id, custom_headers = nil) + response = get_entity_state_async(resource_group_name, service_name, tag_id, custom_headers).value! + nil + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_with_http_info(resource_group_name, service_name, tag_id, custom_headers = nil) + get_entity_state_async(resource_group_name, service_name, tag_id, custom_headers).value! + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_async(resource_group_name, service_name, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'tagId' => tag_id,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagContract] operation results. + # + def get(resource_group_name, service_name, tag_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, tag_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, tag_id, custom_headers = nil) + get_async(resource_group_name, service_name, tag_id, custom_headers).value! + end + + # + # Gets the details of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'tagId' => tag_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.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 + + # + # Creates a tag. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagCreateUpdateParameters] Create parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagContract] operation results. + # + def create_or_update(resource_group_name, service_name, tag_id, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, tag_id, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a tag. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagCreateUpdateParameters] Create 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. + # + def create_or_update_with_http_info(resource_group_name, service_name, tag_id, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, tag_id, parameters, custom_headers).value! + end + + # + # Creates a tag. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagCreateUpdateParameters] Create 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. + # + def create_or_update_async(resource_group_name, service_name, tag_id, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'tagId' => tag_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.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 + + # + # Updates the details of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagCreateUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, tag_id, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, tag_id, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagCreateUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, tag_id, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, tag_id, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagCreateUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, tag_id, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'tagId' => tag_id,'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 == 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 + end + + promise.execute + end + + # + # Deletes specific tag of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, tag_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, tag_id, if_match, custom_headers).value! + nil + end + + # + # Deletes specific tag of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, tag_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, tag_id, if_match, custom_headers).value! + end + + # + # Deletes specific tag of the API Management service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, tag_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'tagId' => tag_id,'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 + end + + promise.execute + end + + # + # Lists all Tags associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_api(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all Tags associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all Tags associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_api_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/tags' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCollection.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 + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_state_by_api(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + response = get_entity_state_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers).value! + nil + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_by_api_with_http_info(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + get_entity_state_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers).value! + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'tagId' => tag_id,'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(:head, 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 + end + + promise.execute + end + + # + # Get tag associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagContract] operation results. + # + def get_by_api(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + response = get_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get tag associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_by_api_with_http_info(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + get_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers).value! + end + + # + # Get tag associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'tagId' => tag_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.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 + + # + # Assign tag to the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagContract] operation results. + # + def assign_to_api(resource_group_name, service_name, api_id, tag_id, if_match = nil, custom_headers = nil) + response = assign_to_api_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Assign tag to the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def assign_to_api_with_http_info(resource_group_name, service_name, api_id, tag_id, if_match = nil, custom_headers = nil) + assign_to_api_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers).value! + end + + # + # Assign tag to the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def assign_to_api_async(resource_group_name, service_name, api_id, tag_id, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'tagId' => tag_id,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.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 + + # + # Detach the tag from the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def detach_from_api(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers = nil) + response = detach_from_api_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers).value! + nil + end + + # + # Detach the tag from the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def detach_from_api_with_http_info(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers = nil) + detach_from_api_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers).value! + end + + # + # Detach the tag from the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def detach_from_api_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'tagId' => tag_id,'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 + end + + promise.execute + end + + # + # Lists all Tags associated with the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_operation(resource_group_name, service_name, api_id, operation_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_operation_as_lazy(resource_group_name, service_name, api_id, operation_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all Tags associated with the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_operation_with_http_info(resource_group_name, service_name, api_id, operation_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_operation_async(resource_group_name, service_name, api_id, operation_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all Tags associated with the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_operation_async(resource_group_name, service_name, api_id, operation_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCollection.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 + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_state_by_operation(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers = nil) + response = get_entity_state_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers).value! + nil + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_by_operation_with_http_info(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers = nil) + get_entity_state_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers).value! + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'tagId' => tag_id,'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(:head, 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 + end + + promise.execute + end + + # + # Get tag associated with the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagContract] operation results. + # + def get_by_operation(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers = nil) + response = get_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get tag associated with the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_by_operation_with_http_info(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers = nil) + get_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers).value! + end + + # + # Get tag associated with the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'tagId' => tag_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.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 + + # + # Assign tag to the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagContract] operation results. + # + def assign_to_operation(resource_group_name, service_name, api_id, operation_id, tag_id, if_match = nil, custom_headers = nil) + response = assign_to_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Assign tag to the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def assign_to_operation_with_http_info(resource_group_name, service_name, api_id, operation_id, tag_id, if_match = nil, custom_headers = nil) + assign_to_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, if_match, custom_headers).value! + end + + # + # Assign tag to the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def assign_to_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'tagId' => tag_id,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.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 + + # + # Detach the tag from the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def detach_from_operation(resource_group_name, service_name, api_id, operation_id, tag_id, if_match, custom_headers = nil) + response = detach_from_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, if_match, custom_headers).value! + nil + end + + # + # Detach the tag from the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def detach_from_operation_with_http_info(resource_group_name, service_name, api_id, operation_id, tag_id, if_match, custom_headers = nil) + detach_from_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, if_match, custom_headers).value! + end + + # + # Detach the tag from the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def detach_from_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'operationId' => operation_id,'tagId' => tag_id,'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 + end + + promise.execute + end + + # + # Lists all Tags associated with the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_product(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_product_as_lazy(resource_group_name, service_name, product_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all Tags associated with the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_product_with_http_info(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all Tags associated with the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_product_async(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/tags' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCollection.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 + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_state_by_product(resource_group_name, service_name, product_id, tag_id, custom_headers = nil) + response = get_entity_state_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers).value! + nil + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_by_product_with_http_info(resource_group_name, service_name, product_id, tag_id, custom_headers = nil) + get_entity_state_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers).value! + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'tagId' => tag_id,'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(:head, 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 + end + + promise.execute + end + + # + # Get tag associated with the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagContract] operation results. + # + def get_by_product(resource_group_name, service_name, product_id, tag_id, custom_headers = nil) + response = get_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get tag associated with the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_by_product_with_http_info(resource_group_name, service_name, product_id, tag_id, custom_headers = nil) + get_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers).value! + end + + # + # Get tag associated with the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'tagId' => tag_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.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 + + # + # Assign tag to the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagContract] operation results. + # + def assign_to_product(resource_group_name, service_name, product_id, tag_id, if_match = nil, custom_headers = nil) + response = assign_to_product_async(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Assign tag to the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def assign_to_product_with_http_info(resource_group_name, service_name, product_id, tag_id, if_match = nil, custom_headers = nil) + assign_to_product_async(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers).value! + end + + # + # Assign tag to the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def assign_to_product_async(resource_group_name, service_name, product_id, tag_id, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'tagId' => tag_id,'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(: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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagContract.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 + + # + # Detach the tag from the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def detach_from_product(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers = nil) + response = detach_from_product_async(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers).value! + nil + end + + # + # Detach the tag from the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def detach_from_product_with_http_info(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers = nil) + detach_from_product_async(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers).value! + end + + # + # Detach the tag from the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def detach_from_product_async(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'product_id is nil' if product_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'productId' => product_id,'tagId' => tag_id,'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 + end + + promise.execute + end + + # + # Lists a collection of tags defined within a service instance. + # + # @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 [TagCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of tags defined within a service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of tags defined within a service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCollection.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 + + # + # Lists all Tags associated with the API. + # + # @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 [TagCollection] operation results. + # + def list_by_api_next(next_page_link, custom_headers = nil) + response = list_by_api_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all Tags associated with the API. + # + # @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. + # + def list_by_api_next_with_http_info(next_page_link, custom_headers = nil) + list_by_api_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all Tags associated with the API. + # + # @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. + # + def list_by_api_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCollection.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 + + # + # Lists all Tags associated with the Operation. + # + # @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 [TagCollection] operation results. + # + def list_by_operation_next(next_page_link, custom_headers = nil) + response = list_by_operation_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all Tags associated with the Operation. + # + # @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. + # + def list_by_operation_next_with_http_info(next_page_link, custom_headers = nil) + list_by_operation_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all Tags associated with the Operation. + # + # @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. + # + def list_by_operation_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCollection.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 + + # + # Lists all Tags associated with the Product. + # + # @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 [TagCollection] operation results. + # + def list_by_product_next(next_page_link, custom_headers = nil) + response = list_by_product_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all Tags associated with the Product. + # + # @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. + # + def list_by_product_next_with_http_info(next_page_link, custom_headers = nil) + list_by_product_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all Tags associated with the Product. + # + # @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. + # + def list_by_product_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagCollection.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 + + # + # Lists a collection of tags defined within a service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagCollection] which provide lazy access to pages of the response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists all Tags associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagCollection] which provide lazy access to pages of the response. + # + def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_api_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists all Tags associated with the Operation. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param operation_id [String] Operation identifier within an API. Must be + # unique in the current API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagCollection] which provide lazy access to pages of the response. + # + def list_by_operation_as_lazy(resource_group_name, service_name, api_id, operation_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_operation_async(resource_group_name, service_name, api_id, operation_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_operation_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists all Tags associated with the Product. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param product_id [String] Product identifier. Must be unique in the current + # API Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagCollection] which provide lazy access to pages of the response. + # + def list_by_product_as_lazy(resource_group_name, service_name, product_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_product_async(resource_group_name, service_name, product_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_product_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag_description.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag_description.rb new file mode 100644 index 0000000000..1bb72e0029 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag_description.rb @@ -0,0 +1,739 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class TagDescription + include MsRestAzure + + # + # Creates and initializes a new instance of the TagDescription class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all Tags descriptions in scope of API. Model similar to swagger - + # tagDescription is defined on API level but tag may be assigned to the + # Operations + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_api(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all Tags descriptions in scope of API. Model similar to swagger - + # tagDescription is defined on API level but tag may be assigned to the + # Operations + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + end + + # + # Lists all Tags descriptions in scope of API. Model similar to swagger - + # tagDescription is defined on API level but tag may be assigned to the + # Operations + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_api_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagDescriptionCollection.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 + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_state(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + response = get_entity_state_async(resource_group_name, service_name, api_id, tag_id, custom_headers).value! + nil + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_with_http_info(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + get_entity_state_async(resource_group_name, service_name, api_id, tag_id, custom_headers).value! + end + + # + # Gets the entity state version of the tag specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_state_async(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'tagId' => tag_id,'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(:head, 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 + end + + promise.execute + end + + # + # Get tag associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagDescriptionContract] operation results. + # + def get(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + response = get_async(resource_group_name, service_name, api_id, tag_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Get tag associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + get_async(resource_group_name, service_name, api_id, tag_id, custom_headers).value! + end + + # + # Get tag associated with the API. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, api_id, tag_id, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'tagId' => tag_id,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagDescriptionContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create/Update tag fescription in scope of the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagDescriptionCreateParameters] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagDescriptionContract] operation results. + # + def create_or_update(resource_group_name, service_name, api_id, tag_id, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, api_id, tag_id, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Create/Update tag fescription in scope of the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagDescriptionCreateParameters] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, api_id, tag_id, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, api_id, tag_id, parameters, if_match, custom_headers).value! + end + + # + # Create/Update tag fescription in scope of the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param parameters [TagDescriptionCreateParameters] Create parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, api_id, tag_id, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagDescriptionCreateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'tagId' => tag_id,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagDescriptionContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagDescriptionContract.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 + + # + # Delete tag description for the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers = nil) + response = delete_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers).value! + nil + end + + # + # Delete tag description for the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers = nil) + delete_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers).value! + end + + # + # Delete tag description for the Api. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param tag_id [String] Tag identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def delete_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'api_id is nil' if api_id.nil? + fail ArgumentError, 'tag_id is nil' if tag_id.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'apiId' => api_id,'tagId' => tag_id,'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 + end + + promise.execute + end + + # + # Lists all Tags descriptions in scope of API. Model similar to swagger - + # tagDescription is defined on API level but tag may be assigned to the + # Operations + # + # @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 [TagDescriptionCollection] operation results. + # + def list_by_api_next(next_page_link, custom_headers = nil) + response = list_by_api_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all Tags descriptions in scope of API. Model similar to swagger - + # tagDescription is defined on API level but tag may be assigned to the + # Operations + # + # @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. + # + def list_by_api_next_with_http_info(next_page_link, custom_headers = nil) + list_by_api_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all Tags descriptions in scope of API. Model similar to swagger - + # tagDescription is defined on API level but tag may be assigned to the + # Operations + # + # @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. + # + def list_by_api_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagDescriptionCollection.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 + + # + # Lists all Tags descriptions in scope of API. Model similar to swagger - + # tagDescription is defined on API level but tag may be assigned to the + # Operations + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param api_id [String] API revision identifier. Must be unique in the current + # API Management service instance. Non-current revision has ;rev=n as a suffix + # where n is the revision number. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagDescriptionCollection] which provide lazy access to pages of the + # response. + # + def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_api_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag_resource.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag_resource.rb new file mode 100644 index 0000000000..4ca92e500b --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag_resource.rb @@ -0,0 +1,349 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class TagResource + include MsRestAzure + + # + # Creates and initializes a new instance of the TagResource class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of resources associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | isCurrent | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of resources associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | isCurrent | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of resources associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | isCurrent | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tagResources' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagResourceCollection.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 + + # + # Lists a collection of resources associated with tags. + # + # @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 [TagResourceCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of resources associated with tags. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of resources associated with tags. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TagResourceCollection.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 + + # + # Lists a collection of resources associated with tags. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | isCurrent | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TagResourceCollection] which provide lazy access to pages of the + # response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_access.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_access.rb new file mode 100644 index 0000000000..457bc23cc4 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_access.rb @@ -0,0 +1,387 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class TenantAccess + include MsRestAzure + + # + # Creates and initializes a new instance of the TenantAccess class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Get tenant access information details. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AccessInformationContract] operation results. + # + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get tenant access information details. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Get tenant access information details. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + access_name = 'access' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tenant/{accessName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'accessName' => access_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AccessInformationContract.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 tenant access information details. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [AccessInformationUpdateParameters] Parameters supplied to + # retrieve the Tenant Access Information. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! + nil + end + + # + # Update tenant access information details. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [AccessInformationUpdateParameters] Parameters supplied to + # retrieve the Tenant Access Information. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, parameters, if_match, custom_headers).value! + end + + # + # Update tenant access information details. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [AccessInformationUpdateParameters] Parameters supplied to + # retrieve the Tenant Access Information. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + access_name = 'access' + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AccessInformationUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'accessName' => access_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 == 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 + end + + promise.execute + end + + # + # Regenerate primary access key. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def regenerate_primary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Regenerate primary access key. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Regenerate primary access key. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def regenerate_primary_key_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + access_name = 'access' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'accessName' => access_name}, + 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 + end + + promise.execute + end + + # + # Regenerate secondary access key. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def regenerate_secondary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Regenerate secondary access key. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Regenerate secondary access key. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + access_name = 'access' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'accessName' => access_name}, + 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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_access_git.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_access_git.rb new file mode 100644 index 0000000000..8d4e30884c --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_access_git.rb @@ -0,0 +1,279 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class TenantAccessGit + include MsRestAzure + + # + # Creates and initializes a new instance of the TenantAccessGit class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Gets the Git access configuration for the tenant. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AccessInformationContract] operation results. + # + def get(resource_group_name, service_name, custom_headers = nil) + response = get_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Git access configuration for the tenant. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets the Git access configuration for the tenant. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + access_name = 'access' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tenant/{accessName}/git' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'accessName' => access_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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::AccessInformationContract.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 primary access key for GIT. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def regenerate_primary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Regenerate primary access key for GIT. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def regenerate_primary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_primary_key_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Regenerate primary access key for GIT. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def regenerate_primary_key_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + access_name = 'access' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'accessName' => access_name}, + 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 + end + + promise.execute + end + + # + # Regenerate secondary access key for GIT. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def regenerate_secondary_key(resource_group_name, service_name, custom_headers = nil) + response = regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! + nil + end + + # + # Regenerate secondary access key for GIT. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def regenerate_secondary_key_with_http_info(resource_group_name, service_name, custom_headers = nil) + regenerate_secondary_key_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Regenerate secondary access key for GIT. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def regenerate_secondary_key_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + access_name = 'access' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'accessName' => access_name}, + 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 + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb new file mode 100644 index 0000000000..92fbedf980 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb @@ -0,0 +1,597 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class TenantConfiguration + include MsRestAzure + + # + # Creates and initializes a new instance of the TenantConfiguration class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # This operation applies changes from the specified Git branch to the + # configuration database. This is a long running operation and could take + # several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Deploy Configuration + # parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationResultContract] operation results. + # + def deploy(resource_group_name, service_name, parameters, custom_headers = nil) + response = deploy_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Deploy Configuration + # parameters. + # @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. + # + def deploy_async(resource_group_name, service_name, parameters, custom_headers = nil) + # Send request + promise = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationResultContract.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 + + # + # This operation creates a commit with the current configuration snapshot to + # the specified branch in the repository. This is a long running operation and + # could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [SaveConfigurationParameter] Save Configuration parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationResultContract] operation results. + # + def save(resource_group_name, service_name, parameters, custom_headers = nil) + response = save_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [SaveConfigurationParameter] Save Configuration parameters. + # @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. + # + def save_async(resource_group_name, service_name, parameters, custom_headers = nil) + # Send request + promise = begin_save_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationResultContract.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 + + # + # This operation validates the changes in the specified Git branch. This is a + # long running operation and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Validate Configuration + # parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationResultContract] operation results. + # + def validate(resource_group_name, service_name, parameters, custom_headers = nil) + response = validate_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Validate Configuration + # parameters. + # @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. + # + def validate_async(resource_group_name, service_name, parameters, custom_headers = nil) + # Send request + promise = begin_validate_async(resource_group_name, service_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationResultContract.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 + + # + # Gets the status of the most recent synchronization between the configuration + # database and the Git repository. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TenantConfigurationSyncStateContract] operation results. + # + def get_sync_state(resource_group_name, service_name, custom_headers = nil) + response = get_sync_state_async(resource_group_name, service_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the status of the most recent synchronization between the configuration + # database and the Git repository. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_sync_state_with_http_info(resource_group_name, service_name, custom_headers = nil) + get_sync_state_async(resource_group_name, service_name, custom_headers).value! + end + + # + # Gets the status of the most recent synchronization between the configuration + # database and the Git repository. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @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. + # + def get_sync_state_async(resource_group_name, service_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + configuration_name = 'configuration' + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'configurationName' => configuration_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::TenantConfigurationSyncStateContract.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 + + # + # This operation applies changes from the specified Git branch to the + # configuration database. This is a long running operation and could take + # several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Deploy Configuration + # parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationResultContract] operation results. + # + def begin_deploy(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # This operation applies changes from the specified Git branch to the + # configuration database. This is a long running operation and could take + # several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Deploy Configuration + # 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. + # + def begin_deploy_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_deploy_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # This operation applies changes from the specified Git branch to the + # configuration database. This is a long running operation and could take + # several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Deploy Configuration + # 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. + # + def begin_deploy_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + configuration_name = 'configuration' + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DeployConfigurationParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'configurationName' => configuration_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 == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationResultContract.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 + + # + # This operation creates a commit with the current configuration snapshot to + # the specified branch in the repository. This is a long running operation and + # could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [SaveConfigurationParameter] Save Configuration parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationResultContract] operation results. + # + def begin_save(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_save_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # This operation creates a commit with the current configuration snapshot to + # the specified branch in the repository. This is a long running operation and + # could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [SaveConfigurationParameter] Save Configuration 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. + # + def begin_save_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_save_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # This operation creates a commit with the current configuration snapshot to + # the specified branch in the repository. This is a long running operation and + # could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [SaveConfigurationParameter] Save Configuration 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. + # + def begin_save_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + configuration_name = 'configuration' + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SaveConfigurationParameter.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'configurationName' => configuration_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 == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationResultContract.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 + + # + # This operation validates the changes in the specified Git branch. This is a + # long running operation and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Validate Configuration + # parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationResultContract] operation results. + # + def begin_validate(resource_group_name, service_name, parameters, custom_headers = nil) + response = begin_validate_async(resource_group_name, service_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # This operation validates the changes in the specified Git branch. This is a + # long running operation and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Validate Configuration + # 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. + # + def begin_validate_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil) + begin_validate_async(resource_group_name, service_name, parameters, custom_headers).value! + end + + # + # This operation validates the changes in the specified Git branch. This is a + # long running operation and could take several minutes to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param parameters [DeployConfigurationParameters] Validate Configuration + # 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. + # + def begin_validate_async(resource_group_name, service_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + configuration_name = 'configuration' + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::DeployConfigurationParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'configurationName' => configuration_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 == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::OperationResultContract.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 + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user.rb new file mode 100644 index 0000000000..d1805c5590 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user.rb @@ -0,0 +1,1049 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class User + include MsRestAzure + + # + # Creates and initializes a new instance of the User class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists a collection of registered users in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_service(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_by_service_as_lazy(resource_group_name, service_name, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists a collection of registered users in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_with_http_info(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + end + + # + # Lists a collection of registered users in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_by_service_async(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/users' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserCollection.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 + + # + # Gets the entity state (Etag) version of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def get_entity_tag(resource_group_name, service_name, uid, custom_headers = nil) + response = get_entity_tag_async(resource_group_name, service_name, uid, custom_headers).value! + nil + end + + # + # Gets the entity state (Etag) version of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_tag_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + get_entity_tag_async(resource_group_name, service_name, uid, custom_headers).value! + end + + # + # Gets the entity state (Etag) version of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_entity_tag_async(resource_group_name, service_name, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/users/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'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(:head, 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 + end + + promise.execute + end + + # + # Gets the details of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UserContract] operation results. + # + def get(resource_group_name, service_name, uid, custom_headers = nil) + response = get_async(resource_group_name, service_name, uid, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the details of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + get_async(resource_group_name, service_name, uid, custom_headers).value! + end + + # + # Gets the details of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def get_async(resource_group_name, service_name, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/users/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserContract.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 + + # + # Creates or Updates a user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserCreateParameters] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UserContract] operation results. + # + def create_or_update(resource_group_name, service_name, uid, parameters, if_match = nil, custom_headers = nil) + response = create_or_update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or Updates a user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserCreateParameters] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_with_http_info(resource_group_name, service_name, uid, parameters, if_match = nil, custom_headers = nil) + create_or_update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers).value! + end + + # + # Creates or Updates a user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserCreateParameters] Create or update parameters. + # @param if_match [String] ETag of the Entity. Not required when creating an + # entity, but required when updating an entity. + # @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. + # + def create_or_update_async(resource_group_name, service_name, uid, parameters, if_match = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserCreateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'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 == 201 || 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? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserContract.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserContract.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 + + # + # Updates the details of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def update(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) + response = update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers).value! + nil + end + + # + # Updates the details of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_with_http_info(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) + update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers).value! + end + + # + # Updates the details of the user specified by its identifier. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserUpdateParameters] Update parameters. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @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. + # + def update_async(resource_group_name, service_name, uid, parameters, if_match, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'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 == 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 + end + + promise.execute + end + + # + # Deletes specific user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_subscriptions [Boolean] Whether to delete user's subscription + # or not. + # @param notify [Boolean] Send an Account Closed Email notification to the + # User. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, notify = nil, custom_headers = nil) + response = delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions, notify, custom_headers).value! + nil + end + + # + # Deletes specific user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_subscriptions [Boolean] Whether to delete user's subscription + # or not. + # @param notify [Boolean] Send an Account Closed Email notification to the + # User. + # @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. + # + def delete_with_http_info(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, notify = nil, custom_headers = nil) + delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions, notify, custom_headers).value! + end + + # + # Deletes specific user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param if_match [String] ETag of the Entity. ETag should match the current + # entity state from the header response of the GET request or it should be * + # for unconditional update. + # @param delete_subscriptions [Boolean] Whether to delete user's subscription + # or not. + # @param notify [Boolean] Send an Account Closed Email notification to the + # User. + # @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. + # + def delete_async(resource_group_name, service_name, uid, if_match, delete_subscriptions = nil, notify = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, 'if_match is nil' if if_match.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['If-Match'] = if_match unless if_match.nil? + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'subscriptionId' => @client.subscription_id}, + query_params: {'deleteSubscriptions' => delete_subscriptions,'notify' => notify,'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 + end + + promise.execute + end + + # + # Retrieves a redirection URL containing an authentication token for signing a + # given user into the developer portal. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GenerateSsoUrlResult] operation results. + # + def generate_sso_url(resource_group_name, service_name, uid, custom_headers = nil) + response = generate_sso_url_async(resource_group_name, service_name, uid, custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves a redirection URL containing an authentication token for signing a + # given user into the developer portal. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def generate_sso_url_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + generate_sso_url_async(resource_group_name, service_name, uid, custom_headers).value! + end + + # + # Retrieves a redirection URL containing an authentication token for signing a + # given user into the developer portal. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def generate_sso_url_async(resource_group_name, service_name, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/users/{uid}/generateSsoUrl' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GenerateSsoUrlResult.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 + + # + # Gets the Shared Access Authorization Token for the User. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserTokenParameters] Create Authorization Token + # parameters. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UserTokenResult] operation results. + # + def get_shared_access_token(resource_group_name, service_name, uid, parameters, custom_headers = nil) + response = get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Shared Access Authorization Token for the User. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserTokenParameters] Create Authorization Token + # 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. + # + def get_shared_access_token_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers = nil) + get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers).value! + end + + # + # Gets the Shared Access Authorization Token for the User. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param parameters [UserTokenParameters] Create Authorization Token + # 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. + # + def get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserTokenParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/token' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserTokenResult.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 + + # + # Lists a collection of registered users in the specified service instance. + # + # @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 [UserCollection] operation results. + # + def list_by_service_next(next_page_link, custom_headers = nil) + response = list_by_service_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists a collection of registered users in the specified service instance. + # + # @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. + # + def list_by_service_next_with_http_info(next_page_link, custom_headers = nil) + list_by_service_next_async(next_page_link, custom_headers).value! + end + + # + # Lists a collection of registered users in the specified service instance. + # + # @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. + # + def list_by_service_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserCollection.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 + + # + # Lists a collection of registered users in the specified service instance. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param filter [String] | Field | Supported operators | + # Supported functions | + # |------------------|------------------------|-----------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | firstName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | lastName | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | email | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # | state | eq | N/A + # | + # | registrationDate | ge, le, eq, ne, gt, lt | N/A + # | + # | note | ge, le, eq, ne, gt, lt | substringof, contains, + # startswith, endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UserCollection] which provide lazy access to pages of the response. + # + def list_by_service_as_lazy(resource_group_name, service_name, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_by_service_async(resource_group_name, service_name, filter, top, skip, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_service_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_group.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_group.rb new file mode 100644 index 0000000000..1d0eebc173 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_group.rb @@ -0,0 +1,277 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class UserGroup + include MsRestAzure + + # + # Creates and initializes a new instance of the UserGroup class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all user groups. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, uid, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists all user groups. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_with_http_info(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! + end + + # + # Lists all user groups. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_async(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/users/{uid}/groups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupCollection.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 + + # + # Lists all user groups. + # + # @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 [GroupCollection] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all user groups. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all user groups. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::GroupCollection.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 + + # + # Lists all user groups. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |-------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GroupCollection] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_async(resource_group_name, service_name, uid, filter, top, skip, 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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_identities.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_identities.rb new file mode 100644 index 0000000000..b413cdf3cb --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_identities.rb @@ -0,0 +1,234 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class UserIdentities + include MsRestAzure + + # + # Creates and initializes a new instance of the UserIdentities class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists all user identities. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, service_name, uid, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, uid, custom_headers) + first_page.get_all_items + end + + # + # Lists all user identities. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def list_with_http_info(resource_group_name, service_name, uid, custom_headers = nil) + list_async(resource_group_name, service_name, uid, custom_headers).value! + end + + # + # Lists all user identities. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @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. + # + def list_async(resource_group_name, service_name, uid, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/users/{uid}/identities' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserIdentityCollection.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 + + # + # Lists all user identities. + # + # @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 [UserIdentityCollection] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all user identities. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all user identities. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::UserIdentityCollection.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 + + # + # Lists all user identities. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UserIdentityCollection] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, service_name, uid, custom_headers = nil) + response = list_async(resource_group_name, service_name, uid, 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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_subscription.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_subscription.rb new file mode 100644 index 0000000000..9c4f4ddb48 --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user_subscription.rb @@ -0,0 +1,302 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + # + # ApiManagement Client + # + class UserSubscription + include MsRestAzure + + # + # Creates and initializes a new instance of the UserSubscription class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ApiManagementClient] reference to the ApiManagementClient + attr_reader :client + + # + # Lists the collection of subscriptions of the specified user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, service_name, uid, filter, top, skip, custom_headers) + first_page.get_all_items + end + + # + # Lists the collection of subscriptions of the specified user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_with_http_info(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + list_async(resource_group_name, service_name, uid, filter, top, skip, custom_headers).value! + end + + # + # Lists the collection of subscriptions of the specified user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @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. + # + def list_async(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'service_name is nil' if service_name.nil? + fail ArgumentError, 'uid is nil' if uid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # 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.ApiManagement/service/{serviceName}/users/{uid}/subscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'uid' => uid,'subscriptionId' => @client.subscription_id}, + query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionCollection.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 + + # + # Lists the collection of subscriptions of the specified user. + # + # @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 [SubscriptionCollection] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the collection of subscriptions of the specified user. + # + # @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. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists the collection of subscriptions of the specified user. + # + # @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. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # 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? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01_preview::Models::SubscriptionCollection.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 + + # + # Lists the collection of subscriptions of the specified user. + # + # @param resource_group_name [String] The name of the resource group. + # @param service_name [String] The name of the API Management service. + # @param uid [String] User identifier. Must be unique in the current API + # Management service instance. + # @param filter [String] | Field | Supported operators | Supported + # functions | + # |--------------|------------------------|---------------------------------------------| + # | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + # endswith | + # | state | eq | + # | + # @param top [Integer] Number of records to return. + # @param skip [Integer] Number of records to skip. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SubscriptionCollection] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, service_name, uid, filter = nil, top = nil, skip = nil, custom_headers = nil) + response = list_async(resource_group_name, service_name, uid, filter, top, skip, 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) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/version.rb b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/version.rb new file mode 100644 index 0000000000..f87ec32dbe --- /dev/null +++ b/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/version.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ApiManagement::Mgmt::V2018_01_01_preview + VERSION = '0.17.0' +end diff --git a/management/azure_mgmt_api_management/lib/azure_mgmt_api_management.rb b/management/azure_mgmt_api_management/lib/azure_mgmt_api_management.rb index d2fc7ef7cf..5e3627f311 100644 --- a/management/azure_mgmt_api_management/lib/azure_mgmt_api_management.rb +++ b/management/azure_mgmt_api_management/lib/azure_mgmt_api_management.rb @@ -2,7 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -require '2018-01-01-preview/generated/azure_mgmt_api_management' -require '2016-10-10/generated/azure_mgmt_api_management' require '2016-07-07/generated/azure_mgmt_api_management' +require '2018-01-01/generated/azure_mgmt_api_management' +require '2016-10-10/generated/azure_mgmt_api_management' +require '2018-01-01-preview/generated/azure_mgmt_api_management' require 'profiles/latest/apimanagement_latest_profile_client'