public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AWSSupport.Model.ResolveCaseRequest(); if (cmdletContext.CaseId != null) { request.CaseId = cmdletContext.CaseId; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
IAsyncResult invokeResolveCase(ResolveCaseRequest resolveCaseRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ResolveCaseRequestMarshaller().Marshall(resolveCaseRequest); var unmarshaller = ResolveCaseResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the ResolveCase operation. /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport.ResolveCase"/> /// </summary> /// /// <param name="resolveCaseRequest">Container for the necessary parameters to execute the ResolveCase 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 EndResolveCase /// operation.</returns> public IAsyncResult BeginResolveCase(ResolveCaseRequest resolveCaseRequest, AsyncCallback callback, object state) { return invokeResolveCase(resolveCaseRequest, callback, state, false); }
/// <summary> /// <para>Takes a <c>CaseId</c> and returns the initial state of the case along with the state of the case after the call to ResolveCase /// completed.</para> /// </summary> /// /// <param name="resolveCaseRequest">Container for the necessary parameters to execute the ResolveCase service method on /// AmazonAWSSupport.</param> /// /// <returns>The response from the ResolveCase service method, as returned by AmazonAWSSupport.</returns> /// /// <exception cref="InternalServerErrorException"/> /// <exception cref="CaseIdNotFoundException"/> public ResolveCaseResponse ResolveCase(ResolveCaseRequest resolveCaseRequest) { IAsyncResult asyncResult = invokeResolveCase(resolveCaseRequest, null, null, true); return EndResolveCase(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the ResolveCase operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ResolveCase 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 EndResolveCase /// operation.</returns> public IAsyncResult BeginResolveCase(ResolveCaseRequest request, AsyncCallback callback, object state) { var marshaller = new ResolveCaseRequestMarshaller(); var unmarshaller = ResolveCaseResponseUnmarshaller.Instance; return BeginInvoke<ResolveCaseRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Takes a <code>CaseId</code> and returns the initial state of the case along with the /// state of the case after the call to <a>ResolveCase</a> completed. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ResolveCase service method.</param> /// /// <returns>The response from the ResolveCase 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 ResolveCaseResponse ResolveCase(ResolveCaseRequest request) { var marshaller = new ResolveCaseRequestMarshaller(); var unmarshaller = ResolveCaseResponseUnmarshaller.Instance; return Invoke<ResolveCaseRequest,ResolveCaseResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para>Takes a <i>CaseId</i> and returns the initial state of the case along with the state of the case after the call to <a href="http://docs.aws.amazon.com/awssupport/latest/APIReference/API_ResolveCase.html">ResolveCase</a> completed.</para> /// </summary> /// /// <param name="resolveCaseRequest">Container for the necessary parameters to execute the ResolveCase service method on /// AmazonAWSSupport.</param> /// /// <returns>The response from the ResolveCase 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<ResolveCaseResponse> ResolveCaseAsync(ResolveCaseRequest resolveCaseRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ResolveCaseRequestMarshaller(); var unmarshaller = ResolveCaseResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ResolveCaseRequest, ResolveCaseResponse>(resolveCaseRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal ResolveCaseResponse ResolveCase(ResolveCaseRequest request) { var task = ResolveCaseAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the ResolveCase operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ResolveCase 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<ResolveCaseResponse> ResolveCaseAsync(ResolveCaseRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ResolveCaseRequestMarshaller(); var unmarshaller = ResolveCaseResponseUnmarshaller.Instance; return InvokeAsync<ResolveCaseRequest,ResolveCaseResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the ResolveCase operation. /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport.ResolveCase"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ResolveCase 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<ResolveCaseResponse> ResolveCaseAsync(ResolveCaseRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ResolveCaseRequestMarshaller(); var unmarshaller = ResolveCaseResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ResolveCaseRequest, ResolveCaseResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>Takes a <c>CaseId</c> and returns the initial state of the case along with the state of the case after the call to ResolveCase /// completed.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ResolveCase service method on /// AmazonAWSSupport.</param> /// /// <returns>The response from the ResolveCase service method, as returned by AmazonAWSSupport.</returns> /// /// <exception cref="T:Amazon.AWSSupport.Model.InternalServerErrorException" /> /// <exception cref="T:Amazon.AWSSupport.Model.CaseIdNotFoundException" /> public ResolveCaseResponse ResolveCase(ResolveCaseRequest request) { var task = ResolveCaseAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
private Amazon.AWSSupport.Model.ResolveCaseResponse CallAWSServiceOperation(IAmazonAWSSupport client, Amazon.AWSSupport.Model.ResolveCaseRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Support", "ResolveCase"); try { #if DESKTOP return(client.ResolveCase(request)); #elif CORECLR return(client.ResolveCaseAsync(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; } }
IAsyncResult invokeResolveCase(ResolveCaseRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new ResolveCaseRequestMarshaller(); var unmarshaller = ResolveCaseResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }