public HttpResponse DoAction <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 = clientProfile.GetEndpoints(regionId, request.Product, credential, request.LocationProduct);;
            }
            return(DoAction(request, autoRetry, this.maxRetryNumber, regionId, credential, signer, format, endpoints));
        }
示例#2
0
        public HttpResponse DoAction <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.");
            }
            string regionId = profile.GetRegionId();

            if (null != request.RegionId)
            {
                regionId = request.RegionId;
            }
            Credential      credential = profile.GetCredential();
            ISigner         signer     = profile.GetSigner();
            FormatType?     format     = profile.GetFormat();
            List <Endpoint> endpoints  = null;

            if (request.ProductDomain == null)
            {
                endpoints = profile.GetEndpoints(regionId, request.Product, credential, request.LocationProduct, request.LocationEndpointType);
            }

            return(DoAction(request, autoRetry, maxRetryNumber, regionId, credential, signer, format, endpoints));
        }
示例#3
0
        public HttpResponse DoAction <T>(AcsRequest <T> request, string regionId, Credential credential) where T : AcsResponse
        {
            ISigner signer = null;
            //FormatType format = FormatType.JSON;
            List <Endpoint> endpoints = null;

            if (null != _clientProfile)
            {
                signer = _clientProfile.GetSigner();
                //format = _clientProfile.GetFormat();
                endpoints = _clientProfile.GetEndpoints();
            }
            return(DoAction(request, AutoRetry, MaxRetryNumber, regionId, credential, signer, endpoints));
        }
示例#4
0
        public HttpResponse DoAction <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();
            var credential = profile.GetCredential();
            var signer     = profile.GetSigner();
            //FormatType format = profile.GetFormat();
            var endpoints = profile.GetEndpoints();

            return(DoAction(request, autoRetry, maxRetryNumber, regionId, credential, signer, 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));
        }