Container for the parameters to the DescribeCases operation.

Returns a list of cases that you specify by passing one or more case IDs. In addition, you can filter the cases by date by setting values for the AfterTime and BeforeTime request parameters.

The response returns the following in JSON format:

  1. One or more CaseDetails data types.
  2. One or more NextToken values, which specify where to paginate the returned records represented by the CaseDetails objects.
Inheritance: AmazonAWSSupportRequest
 IAsyncResult invokeDescribeCases(DescribeCasesRequest describeCasesRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new DescribeCasesRequestMarshaller().Marshall(describeCasesRequest);
     var unmarshaller = DescribeCasesResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// <para>Returns a list of cases that you specify by passing one or more case IDs. In addition, you can filter the cases by date by setting
 /// values for the <c>AfterTime</c> and <c>BeforeTime</c> request parameters. </para> <para>The response returns the following in JSON
 /// format:</para> <ol> <li>One or more CaseDetails data types. </li>
 /// <li>One or more <c>NextToken</c> values, which specify where to paginate the returned records represented by the <c>CaseDetails</c>
 /// objects.</li>
 /// </ol>
 /// </summary>
 /// 
 /// <param name="describeCasesRequest">Container for the necessary parameters to execute the DescribeCases service method on
 ///          AmazonAWSSupport.</param>
 /// 
 /// <returns>The response from the DescribeCases service method, as returned by AmazonAWSSupport.</returns>
 /// 
 /// <exception cref="InternalServerErrorException"/>
 /// <exception cref="CaseIdNotFoundException"/>
 public DescribeCasesResponse DescribeCases(DescribeCasesRequest describeCasesRequest)
 {
     IAsyncResult asyncResult = invokeDescribeCases(describeCasesRequest, null, null, true);
     return EndDescribeCases(asyncResult);
 }
 /// <summary>
 /// Initiates the asynchronous execution of the DescribeCases operation.
 /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport.DescribeCases"/>
 /// </summary>
 /// 
 /// <param name="describeCasesRequest">Container for the necessary parameters to execute the DescribeCases operation on
 ///          AmazonAWSSupport.</param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeCases
 ///         operation.</returns>
 public IAsyncResult BeginDescribeCases(DescribeCasesRequest describeCasesRequest, AsyncCallback callback, object state)
 {
     return invokeDescribeCases(describeCasesRequest, callback, state, false);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeCases operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeCases operation on AmazonAWSSupportClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeCases
        ///         operation.</returns>
        public IAsyncResult BeginDescribeCases(DescribeCasesRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DescribeCasesRequestMarshaller();
            var unmarshaller = DescribeCasesResponseUnmarshaller.Instance;

            return BeginInvoke<DescribeCasesRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// Paginator for DescribeCases operation
 ///</summary>
 public IDescribeCasesPaginator DescribeCases(DescribeCasesRequest request)
 {
     return(new DescribeCasesPaginator(this.client, request));
 }
        /// <summary>
        /// <para>This action returns a list of cases that you specify by passing one or more CaseIds. In addition, you can filter the cases by date by
        /// setting values for the AfterTime and BeforeTime request parameters. </para> <para> The response returns the following in JSON format:
        /// </para> <ol> <li>One or more <a href="http://docs.aws.amazon.com/awssupport/latest/APIReference/API_CaseDetails.html">CaseDetails</a> data
        /// types. </li>
        /// <li>One or more <i>NextToken</i> objects, strings that specifies where to paginate the returned records represented by <i>CaseDetails</i>
        /// .</li>
        /// </ol>
        /// </summary>
        /// 
        /// <param name="describeCasesRequest">Container for the necessary parameters to execute the DescribeCases service method on
        /// AmazonAWSSupport.</param>
        /// 
        /// <returns>The response from the DescribeCases service method, as returned by AmazonAWSSupport.</returns>
        /// 
        /// <exception cref="T:Amazon.AWSSupport.Model.InternalServerErrorException" />
        /// <exception cref="T:Amazon.AWSSupport.Model.CaseIdNotFoundException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<DescribeCasesResponse> DescribeCasesAsync(DescribeCasesRequest describeCasesRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeCasesRequestMarshaller();
            var unmarshaller = DescribeCasesResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, DescribeCasesRequest, DescribeCasesResponse>(describeCasesRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
        /// <summary>
        /// Returns a list of cases that you specify by passing one or more case IDs. In addition,
        /// you can filter the cases by date by setting values for the <code>AfterTime</code>
        /// and <code>BeforeTime</code> request parameters. You can set values for the <code>IncludeResolvedCases</code>
        /// and <code>IncludeCommunications</code> request parameters to control how much information
        /// is returned. 
        /// 
        ///  
        /// <para>
        /// Case data is available for 12 months after creation. If a case was created more than
        /// 12 months ago, a request for data might cause an error. 
        /// </para>
        ///  
        /// <para>
        /// The response returns the following in JSON format:
        /// </para>
        ///  <ol> <li>One or more <a>CaseDetails</a> data types. </li> <li>One or more <code>NextToken</code>
        /// values, which specify where to paginate the returned records represented by the <code>CaseDetails</code>
        /// objects.</li> </ol>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeCases service method.</param>
        /// 
        /// <returns>The response from the DescribeCases service method, as returned by AWSSupport.</returns>
        /// <exception cref="Amazon.AWSSupport.Model.CaseIdNotFoundException">
        /// The requested <code>CaseId</code> could not be located.
        /// </exception>
        /// <exception cref="Amazon.AWSSupport.Model.InternalServerErrorException">
        /// An internal server error occurred.
        /// </exception>
        public DescribeCasesResponse DescribeCases(DescribeCasesRequest request)
        {
            var marshaller = new DescribeCasesRequestMarshaller();
            var unmarshaller = DescribeCasesResponseUnmarshaller.Instance;

            return Invoke<DescribeCasesRequest,DescribeCasesResponse>(request, marshaller, unmarshaller);
        }
Example #8
0
 internal DescribeCasesPaginator(IAmazonAWSSupport client, DescribeCasesRequest request)
 {
     this._client  = client;
     this._request = request;
 }
		internal DescribeCasesResponse DescribeCases(DescribeCasesRequest request)
        {
            var task = DescribeCasesAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeCases operation.
        /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport.DescribeCases"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeCases operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
		public Task<DescribeCasesResponse> DescribeCasesAsync(DescribeCasesRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeCasesRequestMarshaller();
            var unmarshaller = DescribeCasesResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, DescribeCasesRequest, DescribeCasesResponse>(request, marshaller, unmarshaller, signer, cancellationToken);
        }
Example #11
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeCases operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeCases operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<DescribeCasesResponse> DescribeCasesAsync(DescribeCasesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeCasesRequestMarshaller();
            var unmarshaller = DescribeCasesResponseUnmarshaller.Instance;

            return InvokeAsync<DescribeCasesRequest,DescribeCasesResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// <para>Returns a list of cases that you specify by passing one or more case IDs. In addition, you can filter the cases by date by setting
        /// values for the <c>AfterTime</c> and <c>BeforeTime</c> request parameters. </para> <para>The response returns the following in JSON
        /// format:</para> <ol> <li>One or more CaseDetails data types. </li>
        /// <li>One or more <c>NextToken</c> values, which specify where to paginate the returned records represented by the <c>CaseDetails</c>
        /// objects.</li>
        /// </ol>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeCases service method on
        /// AmazonAWSSupport.</param>
        /// 
        /// <returns>The response from the DescribeCases service method, as returned by AmazonAWSSupport.</returns>
        /// 
        /// <exception cref="T:Amazon.AWSSupport.Model.InternalServerErrorException" />
        /// <exception cref="T:Amazon.AWSSupport.Model.CaseIdNotFoundException" />
		public DescribeCasesResponse DescribeCases(DescribeCasesRequest request)
        {
            var task = DescribeCasesAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
 private Amazon.AWSSupport.Model.DescribeCasesResponse CallAWSServiceOperation(IAmazonAWSSupport client, Amazon.AWSSupport.Model.DescribeCasesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Support", "DescribeCases");
     try
     {
         #if DESKTOP
         return(client.DescribeCases(request));
         #elif CORECLR
         return(client.DescribeCasesAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext      = context as CmdletContext;
            var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent;

            // create request and set iteration invariants
            var request = new Amazon.AWSSupport.Model.DescribeCasesRequest();

            if (cmdletContext.AfterTime != null)
            {
                request.AfterTime = cmdletContext.AfterTime;
            }
            if (cmdletContext.BeforeTime != null)
            {
                request.BeforeTime = cmdletContext.BeforeTime;
            }
            if (cmdletContext.CaseIdList != null)
            {
                request.CaseIdList = cmdletContext.CaseIdList;
            }
            if (cmdletContext.DisplayId != null)
            {
                request.DisplayId = cmdletContext.DisplayId;
            }
            if (cmdletContext.IncludeCommunication != null)
            {
                request.IncludeCommunications = cmdletContext.IncludeCommunication.Value;
            }
            if (cmdletContext.IncludeResolvedCase != null)
            {
                request.IncludeResolvedCases = cmdletContext.IncludeResolvedCase.Value;
            }
            if (cmdletContext.Language != null)
            {
                request.Language = cmdletContext.Language;
            }

            // Initialize loop variants and commence piping
            System.String _nextToken      = null;
            int?          _emitLimit      = null;
            int           _retrievedSoFar = 0;

            if (AutoIterationHelpers.HasValue(cmdletContext.NextToken))
            {
                _nextToken = cmdletContext.NextToken;
            }
            if (cmdletContext.MaxResult.HasValue)
            {
                // The service has a maximum page size of 100. If the user has
                // asked for more items than page max, and there is no page size
                // configured, we rely on the service ignoring the set maximum
                // and giving us 100 items back. If a page size is set, that will
                // be used to configure the pagination.
                // We'll make further calls to satisfy the user's request.
                _emitLimit = cmdletContext.MaxResult;
            }
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            do
            {
                request.NextToken = _nextToken;
                if (_emitLimit.HasValue)
                {
                    int correctPageSize = Math.Min(100, _emitLimit.Value);
                    request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToInt32(correctPageSize);
                }

                CmdletOutput output;

                try
                {
                    var    response       = CallAWSServiceOperation(client, request);
                    object pipelineOutput = null;
                    if (!useParameterSelect)
                    {
                        pipelineOutput = cmdletContext.Select(response, this);
                    }
                    output = new CmdletOutput
                    {
                        PipelineOutput  = pipelineOutput,
                        ServiceResponse = response
                    };
                    int _receivedThisCall = response.Cases.Count;

                    _nextToken       = response.NextToken;
                    _retrievedSoFar += _receivedThisCall;
                    if (_emitLimit.HasValue)
                    {
                        _emitLimit -= _receivedThisCall;
                    }
                }
                catch (Exception e)
                {
                    if (_retrievedSoFar == 0 || !_emitLimit.HasValue)
                    {
                        output = new CmdletOutput {
                            ErrorResponse = e
                        };
                    }
                    else
                    {
                        break;
                    }
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 10));


            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;

            #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
            var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent;
            #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute

            // create request and set iteration invariants
            var request = new Amazon.AWSSupport.Model.DescribeCasesRequest();

            if (cmdletContext.AfterTime != null)
            {
                request.AfterTime = cmdletContext.AfterTime;
            }
            if (cmdletContext.BeforeTime != null)
            {
                request.BeforeTime = cmdletContext.BeforeTime;
            }
            if (cmdletContext.CaseIdList != null)
            {
                request.CaseIdList = cmdletContext.CaseIdList;
            }
            if (cmdletContext.DisplayId != null)
            {
                request.DisplayId = cmdletContext.DisplayId;
            }
            if (cmdletContext.IncludeCommunication != null)
            {
                request.IncludeCommunications = cmdletContext.IncludeCommunication.Value;
            }
            if (cmdletContext.IncludeResolvedCase != null)
            {
                request.IncludeResolvedCases = cmdletContext.IncludeResolvedCase.Value;
            }
            if (cmdletContext.Language != null)
            {
                request.Language = cmdletContext.Language;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.MaxResult.Value);
            }

            // Initialize loop variant and commence piping
            var _nextToken             = cmdletContext.NextToken;
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
            do
            {
                request.NextToken = _nextToken;

                CmdletOutput output;

                try
                {
                    var response = CallAWSServiceOperation(client, request);

                    object pipelineOutput = null;
                    if (!useParameterSelect)
                    {
                        pipelineOutput = cmdletContext.Select(response, this);
                    }
                    output = new CmdletOutput
                    {
                        PipelineOutput  = pipelineOutput,
                        ServiceResponse = response
                    };

                    _nextToken = response.NextToken;
                }
                catch (Exception e)
                {
                    output = new CmdletOutput {
                        ErrorResponse = e
                    };
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken));

            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }
        IAsyncResult invokeDescribeCases(DescribeCasesRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new DescribeCasesRequestMarshaller();
            var unmarshaller = DescribeCasesResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }