public async Task <HttpResponse> DoActionAsync <T>(AcsRequest <T> request, string regionId, Credential credential, CancellationToken cancellationToken)
            where T : AcsResponse
        {
            var        signer = Signer.GetSigner(new LegacyCredentials(credential));
            FormatType?format = null;

            if (null == request.RegionId)
            {
                request.RegionId = regionId;
            }

            if (request.ProductDomain == null)
            {
                request.ProductDomain = EndpointUserConfig.GetProductDomain(request.Product, request.RegionId);
                if (request.ProductDomain == null)
                {
                    request.SetProductDomain();
                }
            }

            List <Endpoint> endpoints = null;

            if (null != clientProfile)
            {
                format = clientProfile.GetFormat();
                if (request.ProductDomain == null)
                {
                    endpoints = await clientProfile.GetEndpointsAsync(request.Product, request.RegionId, request.LocationProduct,
                                                                      request.LocationEndpointType, cancellationToken).ConfigureAwait(false);
                }
            }

            return(await DoActionAsync(request, AutoRetry, MaxRetryNumber, request.RegionId, credential, signer, format, endpoints, cancellationToken).ConfigureAwait(false));
        }
        public async Task <HttpResponse> DoActionAsync <T>(AcsRequest <T> request, string regionId, Credential credential) where T : AcsResponse
        {
            ISigner         signer    = null;
            FormatType      format    = FormatType.JSON;
            List <Endpoint> endpoints = null;

            if (null != this.clientProfile)
            {
                signer    = clientProfile.GetSigner();
                format    = clientProfile.GetFormat();
                endpoints = await clientProfile.GetEndpointsAsync(regionId, request.Product, credential, request.LocationProduct);;
            }
            return(await DoActionAsync(request, autoRetry, this.maxRetryNumber, regionId, credential, signer, format, endpoints));
        }
        public async Task <HttpResponse> DoActionAsync <T>(AcsRequest <T> request, bool autoRetry,
                                                           int maxRetryNumber, IClientProfile profile) where T : AcsResponse
        {
            if (null == profile)
            {
                throw new ClientException("SDK.InvalidProfile", "No active profile found.");
            }

            var regionId = profile.GetRegionId();

            if (null != request.RegionId)
            {
                regionId = request.RegionId;
            }

            var credential = profile.GetCredential();
            var signer     = profile.GetSigner();
            var format     = profile.GetFormat();
            var endpoints  = await profile.GetEndpointsAsync(regionId, request.Product, credential, request.LocationProduct);

            return(await DoActionAsync(request, autoRetry, maxRetryNumber, regionId, credential, signer, format, endpoints));
        }