# 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::ECRclassEndpointProviderdefresolve_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://api.ecr-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)ifAws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result,"name"),"aws")returnAws::Endpoints::Endpoint.new(url: "https://ecr-fips.#{region}.amazonaws.com",headers: {},properties: {})endifAws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result,"name"),"aws-us-gov")returnAws::Endpoints::Endpoint.new(url: "https://ecr-fips.#{region}.amazonaws.com",headers: {},properties: {})endreturnAws::Endpoints::Endpoint.new(url: "https://api.ecr-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"))returnAws::Endpoints::Endpoint.new(url: "https://api.ecr.#{region}.#{partition_result['dualStackDnsSuffix']}",headers: {},properties: {})endraiseArgumentError,"DualStack is enabled but this partition does not support DualStack"endreturnAws::Endpoints::Endpoint.new(url: "https://api.ecr.#{region}.#{partition_result['dnsSuffix']}",headers: {},properties: {})endendraiseArgumentError,"Invalid Configuration: Missing Region"raiseArgumentError,'No endpoint could be resolved'endendend