IAsyncResult invokeDescribeCommunications(DescribeCommunicationsRequest describeCommunicationsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DescribeCommunicationsRequestMarshaller().Marshall(describeCommunicationsRequest); var unmarshaller = DescribeCommunicationsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Returns communications regarding the support case. You can use the <c>AfterTime</c> and <c>BeforeTime</c> parameters to filter by /// date. The <c>CaseId</c> parameter enables you to identify a specific case by its <c>CaseId</c> value.</para> <para>The <c>MaxResults</c> and /// <c>NextToken</c> parameters enable you to control the pagination of the result set. Set <c>MaxResults</c> to the number of cases you want /// displayed on each page, and use <c>NextToken</c> to specify the resumption of pagination.</para> /// </summary> /// /// <param name="describeCommunicationsRequest">Container for the necessary parameters to execute the DescribeCommunications service method on /// AmazonAWSSupport.</param> /// /// <returns>The response from the DescribeCommunications service method, as returned by AmazonAWSSupport.</returns> /// /// <exception cref="InternalServerErrorException"/> /// <exception cref="CaseIdNotFoundException"/> public DescribeCommunicationsResponse DescribeCommunications(DescribeCommunicationsRequest describeCommunicationsRequest) { IAsyncResult asyncResult = invokeDescribeCommunications(describeCommunicationsRequest, null, null, true); return EndDescribeCommunications(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DescribeCommunications operation. /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport.DescribeCommunications"/> /// </summary> /// /// <param name="describeCommunicationsRequest">Container for the necessary parameters to execute the DescribeCommunications 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 /// EndDescribeCommunications operation.</returns> public IAsyncResult BeginDescribeCommunications(DescribeCommunicationsRequest describeCommunicationsRequest, AsyncCallback callback, object state) { return invokeDescribeCommunications(describeCommunicationsRequest, callback, state, false); }
private Amazon.AWSSupport.Model.DescribeCommunicationsResponse CallAWSServiceOperation(IAmazonAWSSupport client, Amazon.AWSSupport.Model.DescribeCommunicationsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Support", "DescribeCommunications"); try { #if DESKTOP return(client.DescribeCommunications(request)); #elif CORECLR return(client.DescribeCommunicationsAsync(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; } }
/// <summary> /// Paginator for DescribeCommunications operation ///</summary> public IDescribeCommunicationsPaginator DescribeCommunications(DescribeCommunicationsRequest request) { return(new DescribeCommunicationsPaginator(this.client, request)); }
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.DescribeCommunicationsRequest(); if (cmdletContext.AfterTime != null) { request.AfterTime = cmdletContext.AfterTime; } if (cmdletContext.BeforeTime != null) { request.BeforeTime = cmdletContext.BeforeTime; } if (cmdletContext.CaseId != null) { request.CaseId = cmdletContext.CaseId; } 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); }
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.DescribeCommunicationsRequest(); if (cmdletContext.AfterTime != null) { request.AfterTime = cmdletContext.AfterTime; } if (cmdletContext.BeforeTime != null) { request.BeforeTime = cmdletContext.BeforeTime; } if (cmdletContext.CaseId != null) { request.CaseId = cmdletContext.CaseId; } // 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 (AutoIterationHelpers.HasValue(cmdletContext.MaxResult)) { // 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 = AutoIterationHelpers.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.Communications.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); }
/// <summary> /// Returns communications (and attachments) for one or more support cases. You can use /// the <code>AfterTime</code> and <code>BeforeTime</code> parameters to filter by date. /// You can use the <code>CaseId</code> parameter to restrict the results to a particular /// case. /// /// /// <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> /// You can use the <code>MaxResults</code> and <code>NextToken</code> parameters to control /// the pagination of the result set. Set <code>MaxResults</code> to the number of cases /// you want displayed on each page, and use <code>NextToken</code> to specify the resumption /// of pagination. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeCommunications service method.</param> /// /// <returns>The response from the DescribeCommunications 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 DescribeCommunicationsResponse DescribeCommunications(DescribeCommunicationsRequest request) { var marshaller = new DescribeCommunicationsRequestMarshaller(); var unmarshaller = DescribeCommunicationsResponseUnmarshaller.Instance; return Invoke<DescribeCommunicationsRequest,DescribeCommunicationsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DescribeCommunications operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeCommunications 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 EndDescribeCommunications /// operation.</returns> public IAsyncResult BeginDescribeCommunications(DescribeCommunicationsRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeCommunicationsRequestMarshaller(); var unmarshaller = DescribeCommunicationsResponseUnmarshaller.Instance; return BeginInvoke<DescribeCommunicationsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>This action returns communications regarding the support case. You can use the <i>AfterTime</i> and <i>BeforeTime</i> parameters to /// filter by date. The <i>CaseId</i> parameter enables you to identify a specific case by its <i>CaseId</i> number.</para> <para>The /// <i>MaxResults</i> and <i>NextToken</i> parameters enable you to control the pagination of the result set. Set <i>MaxResults</i> to the /// number of cases you want displayed on each page, and use <i>NextToken</i> to specify the resumption of pagination.</para> /// </summary> /// /// <param name="describeCommunicationsRequest">Container for the necessary parameters to execute the DescribeCommunications service method on /// AmazonAWSSupport.</param> /// /// <returns>The response from the DescribeCommunications 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<DescribeCommunicationsResponse> DescribeCommunicationsAsync(DescribeCommunicationsRequest describeCommunicationsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeCommunicationsRequestMarshaller(); var unmarshaller = DescribeCommunicationsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DescribeCommunicationsRequest, DescribeCommunicationsResponse>(describeCommunicationsRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal DescribeCommunicationsPaginator(IAmazonAWSSupport client, DescribeCommunicationsRequest request) { this._client = client; this._request = request; }
internal DescribeCommunicationsResponse DescribeCommunications(DescribeCommunicationsRequest request) { var task = DescribeCommunicationsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the DescribeCommunications operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeCommunications 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<DescribeCommunicationsResponse> DescribeCommunicationsAsync(DescribeCommunicationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeCommunicationsRequestMarshaller(); var unmarshaller = DescribeCommunicationsResponseUnmarshaller.Instance; return InvokeAsync<DescribeCommunicationsRequest,DescribeCommunicationsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DescribeCommunications operation. /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport.DescribeCommunications"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeCommunications 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<DescribeCommunicationsResponse> DescribeCommunicationsAsync(DescribeCommunicationsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeCommunicationsRequestMarshaller(); var unmarshaller = DescribeCommunicationsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DescribeCommunicationsRequest, DescribeCommunicationsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>Returns communications regarding the support case. You can use the <c>AfterTime</c> and <c>BeforeTime</c> parameters to filter by /// date. The <c>CaseId</c> parameter enables you to identify a specific case by its <c>CaseId</c> value.</para> <para>The <c>MaxResults</c> and /// <c>NextToken</c> parameters enable you to control the pagination of the result set. Set <c>MaxResults</c> to the number of cases you want /// displayed on each page, and use <c>NextToken</c> to specify the resumption of pagination.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeCommunications service method on /// AmazonAWSSupport.</param> /// /// <returns>The response from the DescribeCommunications service method, as returned by AmazonAWSSupport.</returns> /// /// <exception cref="T:Amazon.AWSSupport.Model.InternalServerErrorException" /> /// <exception cref="T:Amazon.AWSSupport.Model.CaseIdNotFoundException" /> public DescribeCommunicationsResponse DescribeCommunications(DescribeCommunicationsRequest request) { var task = DescribeCommunicationsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeDescribeCommunications(DescribeCommunicationsRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DescribeCommunicationsRequestMarshaller(); var unmarshaller = DescribeCommunicationsResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }