public async Task <Endpoint> GetEndpointAsync(String regionId, String product, String locationProduct, Credential credential, LocationConfig locationConfig) { if (null == locationProduct) { return(null); } var response = await describeEndpointService.DescribeEndpointAsync(regionId, locationProduct, credential, locationConfig); if (null == response) { return(null); } var regionIds = new HashSet <String> { regionId }; var productDomainList = new List <ProductDomain> { new ProductDomain(product, response.Endpoint) }; var endpoint = new Endpoint(response.RegionId, regionIds, productDomainList); return(endpoint); }
public async Task <Endpoint> GetEndpointAsync(string regionId, string product, string serviceCode, string endpointType, Credential credential, LocationConfig locationConfig, CancellationToken cancellationToken = default(CancellationToken)) { if (serviceCode == null) { return(null); } var response = await describeEndpointService.DescribeEndpointAsync(regionId, serviceCode, endpointType, credential, locationConfig, cancellationToken).ConfigureAwait(false); if (response == null) { return(null); } ISet <string> regionIds = new HashSet <string>(); regionIds.Add(regionId); var productDomainList = new List <ProductDomain>(); productDomainList.Add(new ProductDomain(product, response.Endpoint)); return(new Endpoint(response.RegionId, regionIds, productDomainList)); }