/// <summary> /// Initiates the asynchronous execution of the UpdateGcmChannel operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateGcmChannel operation on AmazonPinpointClient.</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 EndUpdateGcmChannel /// operation.</returns> public IAsyncResult BeginUpdateGcmChannel(UpdateGcmChannelRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateGcmChannelRequestMarshaller(); var unmarshaller = UpdateGcmChannelResponseUnmarshaller.Instance; return BeginInvoke<UpdateGcmChannelRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Use to update the GCM channel for an app. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateGcmChannel service method.</param> /// /// <returns>The response from the UpdateGcmChannel service method, as returned by Pinpoint.</returns> /// <exception cref="Amazon.Pinpoint.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.Pinpoint.Model.ForbiddenException"> /// /// </exception> /// <exception cref="Amazon.Pinpoint.Model.InternalServerErrorException"> /// /// </exception> /// <exception cref="Amazon.Pinpoint.Model.MethodNotAllowedException"> /// /// </exception> /// <exception cref="Amazon.Pinpoint.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.Pinpoint.Model.TooManyRequestsException"> /// /// </exception> public UpdateGcmChannelResponse UpdateGcmChannel(UpdateGcmChannelRequest request) { var marshaller = new UpdateGcmChannelRequestMarshaller(); var unmarshaller = UpdateGcmChannelResponseUnmarshaller.Instance; return Invoke<UpdateGcmChannelRequest,UpdateGcmChannelResponse>(request, marshaller, unmarshaller); }
private Amazon.Pinpoint.Model.UpdateGcmChannelResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.UpdateGcmChannelRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "UpdateGcmChannel"); try { #if DESKTOP return(client.UpdateGcmChannel(request)); #elif CORECLR return(client.UpdateGcmChannelAsync(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> /// Initiates the asynchronous execution of the UpdateGcmChannel operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateGcmChannel 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<UpdateGcmChannelResponse> UpdateGcmChannelAsync(UpdateGcmChannelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateGcmChannelRequestMarshaller(); var unmarshaller = UpdateGcmChannelResponseUnmarshaller.Instance; return InvokeAsync<UpdateGcmChannelRequest,UpdateGcmChannelResponse>(request, marshaller, unmarshaller, cancellationToken); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Pinpoint.Model.UpdateGcmChannelRequest(); if (cmdletContext.ApplicationId != null) { request.ApplicationId = cmdletContext.ApplicationId; } // populate GCMChannelRequest var requestGCMChannelRequestIsNull = true; request.GCMChannelRequest = new Amazon.Pinpoint.Model.GCMChannelRequest(); System.String requestGCMChannelRequest_gCMChannelRequest_ApiKey = null; if (cmdletContext.GCMChannelRequest_ApiKey != null) { requestGCMChannelRequest_gCMChannelRequest_ApiKey = cmdletContext.GCMChannelRequest_ApiKey; } if (requestGCMChannelRequest_gCMChannelRequest_ApiKey != null) { request.GCMChannelRequest.ApiKey = requestGCMChannelRequest_gCMChannelRequest_ApiKey; requestGCMChannelRequestIsNull = false; } System.Boolean?requestGCMChannelRequest_gCMChannelRequest_Enabled = null; if (cmdletContext.GCMChannelRequest_Enabled != null) { requestGCMChannelRequest_gCMChannelRequest_Enabled = cmdletContext.GCMChannelRequest_Enabled.Value; } if (requestGCMChannelRequest_gCMChannelRequest_Enabled != null) { request.GCMChannelRequest.Enabled = requestGCMChannelRequest_gCMChannelRequest_Enabled.Value; requestGCMChannelRequestIsNull = false; } // determine if request.GCMChannelRequest should be set to null if (requestGCMChannelRequestIsNull) { request.GCMChannelRequest = null; } 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); }