# frozen_string_literal: true# WARNING ABOUT GENERATED CODE## This file is generated. See the contributing guide for more information:# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md## WARNING ABOUT GENERATED CODEmoduleAws::ElasticsearchServiceclassEndpointProviderdefresolve_endpoint(parameters)region=parameters.regionuse_dual_stack=parameters.use_dual_stackuse_fips=parameters.use_fipsendpoint=parameters.endpointifAws::Endpoints::Matchers.set?(endpoint)ifAws::Endpoints::Matchers.boolean_equals?(use_fips,true)raiseArgumentError,"Invalid Configuration: FIPS and custom endpoint are not supported"endifAws::Endpoints::Matchers.boolean_equals?(use_dual_stack,true)raiseArgumentError,"Invalid Configuration: Dualstack and custom endpoint are not supported"endreturnAws::Endpoints::Endpoint.new(url: endpoint,headers: {},properties: {})endifAws::Endpoints::Matchers.set?(region)if(partition_result=Aws::Endpoints::Matchers.aws_partition(region))ifAws::Endpoints::Matchers.boolean_equals?(use_fips,true)&&Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack,true)ifAws::Endpoints::Matchers.boolean_equals?(true,Aws::Endpoints::Matchers.attr(partition_result,"supportsFIPS"))&&Aws::Endpoints::Matchers.boolean_equals?(true,Aws::Endpoints::Matchers.attr(partition_result,"supportsDualStack"))returnAws::Endpoints::Endpoint.new(url: "https://es-fips.#{region}.#{partition_result['dualStackDnsSuffix']}",headers: {},properties: {})endraiseArgumentError,"FIPS and DualStack are enabled, but this partition does not support one or both"endifAws::Endpoints::Matchers.boolean_equals?(use_fips,true)ifAws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result,"supportsFIPS"),true)returnAws::Endpoints::Endpoint.new(url: "https://es-fips.#{region}.#{partition_result['dnsSuffix']}",headers: {},properties: {})endraiseArgumentError,"FIPS is enabled but this partition does not support FIPS"endifAws::Endpoints::Matchers.boolean_equals?(use_dual_stack,true)ifAws::Endpoints::Matchers.boolean_equals?(true,Aws::Endpoints::Matchers.attr(partition_result,"supportsDualStack"))ifAws::Endpoints::Matchers.string_equals?("aws",Aws::Endpoints::Matchers.attr(partition_result,"name"))returnAws::Endpoints::Endpoint.new(url: "https://aos.#{region}.api.aws",headers: {},properties: {})endifAws::Endpoints::Matchers.string_equals?("aws-cn",Aws::Endpoints::Matchers.attr(partition_result,"name"))returnAws::Endpoints::Endpoint.new(url: "https://aos.#{region}.api.amazonwebservices.com.cn",headers: {},properties: {})endifAws::Endpoints::Matchers.string_equals?("aws-us-gov",Aws::Endpoints::Matchers.attr(partition_result,"name"))returnAws::Endpoints::Endpoint.new(url: "https://aos.#{region}.api.aws",headers: {},properties: {})endreturnAws::Endpoints::Endpoint.new(url: "https://es.#{region}.#{partition_result['dualStackDnsSuffix']}",headers: {},properties: {})endraiseArgumentError,"DualStack is enabled but this partition does not support DualStack"endreturnAws::Endpoints::Endpoint.new(url: "https://es.#{region}.#{partition_result['dnsSuffix']}",headers: {},properties: {})endendraiseArgumentError,"Invalid Configuration: Missing Region"raiseArgumentError,'No endpoint could be resolved'endendend