/// <summary>
 /// Get Feed Submission List By Next Token
 /// </summary>
 /// <param name="request">Get Feed Submission List By Next Token  request</param>
 /// <returns>Get Feed Submission List By Next Token  Response from the service</returns>
 /// <remarks>
 /// retrieve the next batch of list items and if there are more items to retrieve
 ///
 /// </remarks>
 public GetFeedSubmissionListByNextTokenResponse GetFeedSubmissionListByNextToken(GetFeedSubmissionListByNextTokenRequest request)
 {
     return(Invoke <GetFeedSubmissionListByNextTokenResponse>("GetFeedSubmissionListByNextTokenResponse.xml"));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// retrieve the next batch of list items and if there are more items to retrieve.
        ///
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service.</param>
        /// <param name="request">GetFeedSubmissionListByNextTokenRequest request.</param>
        public static async Task InvokeGetFeedSubmissionListByNextToken(IMarketplaceWebService service, GetFeedSubmissionListByNextTokenRequest request)
        {
            try
            {
                var response = await service.GetFeedSubmissionListByNextToken(request);

                Console.WriteLine("Service Response");
                Console.WriteLine("=============================================================================");
                Console.WriteLine();

                Console.WriteLine("        GetFeedSubmissionListByNextTokenResponse");
                if (response.IsSetGetFeedSubmissionListByNextTokenResult())
                {
                    Console.WriteLine("            GetFeedSubmissionListByNextTokenResult");
                    var getFeedSubmissionListByNextTokenResult = response.GetFeedSubmissionListByNextTokenResult;
                    if (getFeedSubmissionListByNextTokenResult.IsSetNextToken())
                    {
                        Console.WriteLine("                NextToken");
                        Console.WriteLine("                    {0}", getFeedSubmissionListByNextTokenResult.NextToken);
                    }

                    if (getFeedSubmissionListByNextTokenResult.IsSetHasNext())
                    {
                        Console.WriteLine("                HasNext");
                        Console.WriteLine("                    {0}", getFeedSubmissionListByNextTokenResult.HasNext);
                    }

                    var feedSubmissionInfoList = getFeedSubmissionListByNextTokenResult.FeedSubmissionInfo;
                    foreach (var feedSubmissionInfo in feedSubmissionInfoList)
                    {
                        Console.WriteLine("                FeedSubmissionInfo");
                        if (feedSubmissionInfo.IsSetFeedSubmissionId())
                        {
                            Console.WriteLine("                    FeedSubmissionId");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.FeedSubmissionId);
                        }

                        if (feedSubmissionInfo.IsSetFeedType())
                        {
                            Console.WriteLine("                    FeedType");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.FeedType);
                        }

                        if (feedSubmissionInfo.IsSetSubmittedDate())
                        {
                            Console.WriteLine("                    SubmittedDate");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.SubmittedDate);
                        }

                        if (feedSubmissionInfo.IsSetFeedProcessingStatus())
                        {
                            Console.WriteLine("                    FeedProcessingStatus");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.FeedProcessingStatus);
                        }

                        if (feedSubmissionInfo.IsSetStartedProcessingDate())
                        {
                            Console.WriteLine("                    StartedProcessingDate");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.StartedProcessingDate);
                        }

                        if (feedSubmissionInfo.IsSetCompletedProcessingDate())
                        {
                            Console.WriteLine("                    CompletedProcessingDate");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.CompletedProcessingDate);
                        }
                    }
                }

                if (response.IsSetResponseMetadata())
                {
                    Console.WriteLine("            ResponseMetadata");
                    var responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                        Console.WriteLine("                RequestId");
                        Console.WriteLine("                    {0}", responseMetadata.RequestId);
                    }
                }

                Console.WriteLine("            ResponseHeaderMetadata");
                Console.WriteLine("                RequestId");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.RequestId);
                Console.WriteLine("                ResponseContext");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.ResponseContext);
                Console.WriteLine("                Timestamp");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.Timestamp);
            }
            catch (MarketplaceWebServiceException ex)
            {
                Console.WriteLine("Caught Exception: " + ex.Message);
                Console.WriteLine("Response Status Code: " + ex.StatusCode);
                Console.WriteLine("Error Code: " + ex.ErrorCode);
                Console.WriteLine("Error Type: " + ex.ErrorType);
                Console.WriteLine("Request ID: " + ex.RequestId);
                Console.WriteLine("XML: " + ex.XML);
                Console.WriteLine("ResponseHeaderMetadata: " + ex.ResponseHeaderMetadata);
            }
        }
        /// <summary>
        /// retrieve the next batch of list items and if there are more items to retrieve
        ///
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetFeedSubmissionListByNextTokenRequest request</param>
        public static void InvokeGetFeedSubmissionListByNextToken(MarketplaceWebService service, GetFeedSubmissionListByNextTokenRequest request)
        {
            try
            {
                GetFeedSubmissionListByNextTokenResponse response = service.GetFeedSubmissionListByNextToken(request);


                Console.WriteLine("Service Response");
                Console.WriteLine("=============================================================================");
                Console.WriteLine();

                Console.WriteLine("        GetFeedSubmissionListByNextTokenResponse");
                if (response.IsSetGetFeedSubmissionListByNextTokenResult())
                {
                    Console.WriteLine("            GetFeedSubmissionListByNextTokenResult");
                    GetFeedSubmissionListByNextTokenResult getFeedSubmissionListByNextTokenResult = response.GetFeedSubmissionListByNextTokenResult;
                    if (getFeedSubmissionListByNextTokenResult.IsSetNextToken())
                    {
                        Console.WriteLine("                NextToken");
                        Console.WriteLine("                    {0}", getFeedSubmissionListByNextTokenResult.NextToken);
                    }
                    if (getFeedSubmissionListByNextTokenResult.IsSetHasNext())
                    {
                        Console.WriteLine("                HasNext");
                        Console.WriteLine("                    {0}", getFeedSubmissionListByNextTokenResult.HasNext);
                    }
                    List <FeedSubmissionInfo> feedSubmissionInfoList = getFeedSubmissionListByNextTokenResult.FeedSubmissionInfo;
                    foreach (FeedSubmissionInfo feedSubmissionInfo in feedSubmissionInfoList)
                    {
                        Console.WriteLine("                FeedSubmissionInfo");
                        if (feedSubmissionInfo.IsSetFeedSubmissionId())
                        {
                            Console.WriteLine("                    FeedSubmissionId");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.FeedSubmissionId);
                        }
                        if (feedSubmissionInfo.IsSetFeedType())
                        {
                            Console.WriteLine("                    FeedType");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.FeedType);
                        }
                        if (feedSubmissionInfo.IsSetSubmittedDate())
                        {
                            Console.WriteLine("                    SubmittedDate");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.SubmittedDate);
                        }
                        if (feedSubmissionInfo.IsSetFeedProcessingStatus())
                        {
                            Console.WriteLine("                    FeedProcessingStatus");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.FeedProcessingStatus);
                        }
                        if (feedSubmissionInfo.IsSetStartedProcessingDate())
                        {
                            Console.WriteLine("                    StartedProcessingDate");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.StartedProcessingDate);
                        }
                        if (feedSubmissionInfo.IsSetCompletedProcessingDate())
                        {
                            Console.WriteLine("                    CompletedProcessingDate");
                            Console.WriteLine("                        {0}", feedSubmissionInfo.CompletedProcessingDate);
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    Console.WriteLine("            ResponseMetadata");
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                        Console.WriteLine("                RequestId");
                        Console.WriteLine("                    {0}", responseMetadata.RequestId);
                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {
                Console.WriteLine("Caught Exception: " + ex.Message);
                Console.WriteLine("Response Status Code: " + ex.StatusCode);
                Console.WriteLine("Error Code: " + ex.ErrorCode);
                Console.WriteLine("Error Type: " + ex.ErrorType);
                Console.WriteLine("Request ID: " + ex.RequestId);
                Console.WriteLine("XML: " + ex.XML);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Get Feed Submission List By Next Token
 /// </summary>
 /// <param name="request">Get Feed Submission List By Next Token  request</param>
 /// <returns>Get Feed Submission List By Next Token  Response from the service</returns>
 /// <remarks>
 /// retrieve the next batch of list items and if there are more items to retrieve
 ///
 /// </remarks>
 public async Task <GetFeedSubmissionListByNextTokenResponse> GetFeedSubmissionListByNextToken(GetFeedSubmissionListByNextTokenRequest request)
 {
     return(await Invoke <GetFeedSubmissionListByNextTokenResponse>("GetFeedSubmissionListByNextTokenResponse.xml"));
 }
Ejemplo n.º 5
0
        private FeedSubmissionInfo[] _GetFeedSubmissionList(string[] FeedSubmissionIdList, EFeedType[] FeedTypeList, EFeedProcessingStatus[] FeedProcessingStatusList, DateTime SubmittedFromDate, DateTime SubmittedToDate)
        {
            string                       NextToken   = string.Empty;
            AmazonCredential             Credentials = this.GetCredential();
            MarketplaceWebServiceClient  Client      = this.GetClient(Credentials);
            GetFeedSubmissionListRequest Request     = new GetFeedSubmissionListRequest()
            {
                Merchant = Credentials.MerchantID,
                MaxCount = 100
            };

            if (FeedSubmissionIdList != null)
            {
                Request.FeedSubmissionIdList = new IdList()
                {
                    Id = FeedSubmissionIdList.ToList()
                }
            }
            ;
            else if (FeedTypeList != null)
            {
                Request.FeedTypeList = new TypeList()
                {
                    Type = FeedTypeList.Select(Item => EnumStringHandler.GetEnumString <EFeedType>(Item)).ToList()
                }
            }
            ;
            else if (FeedProcessingStatusList != null)
            {
                Request.FeedProcessingStatusList = new StatusList()
                {
                    Status = FeedProcessingStatusList.Select(Item => EnumStringHandler.GetEnumString <EFeedProcessingStatus>(Item)).ToList()
                }
            }
            ;
            else if (SubmittedFromDate != default(DateTime) && SubmittedToDate != default(DateTime))
            {
                Request.SubmittedFromDate = SubmittedFromDate;
                Request.SubmittedToDate   = SubmittedToDate;
            }

            List <FeedSubmissionInfo> Info = new List <FeedSubmissionInfo>();
            Task GetFeedSubmissionListTask = new Task(() =>
            {
                while (true)
                {
                    switch (NextToken == string.Empty)
                    {
                    case true:
                        this.Throttle(ERequestType.GetFeedSubmissionList);
                        GetFeedSubmissionListResponse Response = Client.GetFeedSubmissionList(Request);
                        if (Response.IsSetGetFeedSubmissionListResult())
                        {
                            GetFeedSubmissionListResult Result = Response.GetFeedSubmissionListResult;
                            if (Result.IsSetFeedSubmissionInfo())
                            {
                                foreach (var FeedInfo in Result.FeedSubmissionInfo)
                                {
                                    Info.Add(FeedInfo);
                                }
                            }

                            if (Result.HasNext)
                            {
                                NextToken = Result.NextToken;
                            }
                            else
                            {
                                goto EndOfLoop;
                            }
                        }
                        break;

                    case false:
                        this.Throttle(ERequestType.GetFeedSubmissionListByNextToken);
                        GetFeedSubmissionListByNextTokenRequest RequestNextToken = new GetFeedSubmissionListByNextTokenRequest()
                        {
                            Merchant  = Credentials.MerchantID,
                            NextToken = NextToken,
                        };
                        GetFeedSubmissionListByNextTokenResponse ResponseNextToken = Client.GetFeedSubmissionListByNextToken(RequestNextToken);
                        if (ResponseNextToken.IsSetGetFeedSubmissionListByNextTokenResult())
                        {
                            GetFeedSubmissionListByNextTokenResult ResultNextToken = ResponseNextToken.GetFeedSubmissionListByNextTokenResult;
                            if (ResultNextToken.IsSetFeedSubmissionInfo())
                            {
                                foreach (var FeedInfo in ResultNextToken.FeedSubmissionInfo)
                                {
                                    Info.Add(FeedInfo);
                                }
                            }

                            if (ResultNextToken.HasNext)
                            {
                                NextToken = ResultNextToken.NextToken;
                            }
                            else
                            {
                                goto EndOfLoop;
                            }
                        }
                        break;
                    }
                }
                EndOfLoop:
                Console.Write("");
            });

            GetFeedSubmissionListTask.Start();
            GetFeedSubmissionListTask.Wait((int)Math.Ceiling(TimeSpan.FromMinutes(Definitions.Timeout_Minutes).Add(TimeSpan.FromHours(Definitions.Timeout_Hours)).TotalMilliseconds));
            return(Info.ToArray());
        }