Container for the parameters to the UpdateApnsChannel operation. Use to update the APNs channel for an app.
Inheritance: AmazonPinpointRequest
Exemplo n.º 1
0
 private Amazon.Pinpoint.Model.UpdateApnsChannelResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.UpdateApnsChannelRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "UpdateApnsChannel");
     try
     {
         #if DESKTOP
         return(client.UpdateApnsChannel(request));
         #elif CORECLR
         return(client.UpdateApnsChannelAsync(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;
     }
 }
Exemplo n.º 2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Pinpoint.Model.UpdateApnsChannelRequest();


            // populate APNSChannelRequest
            var requestAPNSChannelRequestIsNull = true;

            request.APNSChannelRequest = new Amazon.Pinpoint.Model.APNSChannelRequest();
            System.String requestAPNSChannelRequest_aPNSChannelRequest_BundleId = null;
            if (cmdletContext.APNSChannelRequest_BundleId != null)
            {
                requestAPNSChannelRequest_aPNSChannelRequest_BundleId = cmdletContext.APNSChannelRequest_BundleId;
            }
            if (requestAPNSChannelRequest_aPNSChannelRequest_BundleId != null)
            {
                request.APNSChannelRequest.BundleId = requestAPNSChannelRequest_aPNSChannelRequest_BundleId;
                requestAPNSChannelRequestIsNull     = false;
            }
            System.String requestAPNSChannelRequest_aPNSChannelRequest_Certificate = null;
            if (cmdletContext.APNSChannelRequest_Certificate != null)
            {
                requestAPNSChannelRequest_aPNSChannelRequest_Certificate = cmdletContext.APNSChannelRequest_Certificate;
            }
            if (requestAPNSChannelRequest_aPNSChannelRequest_Certificate != null)
            {
                request.APNSChannelRequest.Certificate = requestAPNSChannelRequest_aPNSChannelRequest_Certificate;
                requestAPNSChannelRequestIsNull        = false;
            }
            System.String requestAPNSChannelRequest_aPNSChannelRequest_DefaultAuthenticationMethod = null;
            if (cmdletContext.APNSChannelRequest_DefaultAuthenticationMethod != null)
            {
                requestAPNSChannelRequest_aPNSChannelRequest_DefaultAuthenticationMethod = cmdletContext.APNSChannelRequest_DefaultAuthenticationMethod;
            }
            if (requestAPNSChannelRequest_aPNSChannelRequest_DefaultAuthenticationMethod != null)
            {
                request.APNSChannelRequest.DefaultAuthenticationMethod = requestAPNSChannelRequest_aPNSChannelRequest_DefaultAuthenticationMethod;
                requestAPNSChannelRequestIsNull = false;
            }
            System.Boolean?requestAPNSChannelRequest_aPNSChannelRequest_Enabled = null;
            if (cmdletContext.APNSChannelRequest_Enabled != null)
            {
                requestAPNSChannelRequest_aPNSChannelRequest_Enabled = cmdletContext.APNSChannelRequest_Enabled.Value;
            }
            if (requestAPNSChannelRequest_aPNSChannelRequest_Enabled != null)
            {
                request.APNSChannelRequest.Enabled = requestAPNSChannelRequest_aPNSChannelRequest_Enabled.Value;
                requestAPNSChannelRequestIsNull    = false;
            }
            System.String requestAPNSChannelRequest_aPNSChannelRequest_PrivateKey = null;
            if (cmdletContext.APNSChannelRequest_PrivateKey != null)
            {
                requestAPNSChannelRequest_aPNSChannelRequest_PrivateKey = cmdletContext.APNSChannelRequest_PrivateKey;
            }
            if (requestAPNSChannelRequest_aPNSChannelRequest_PrivateKey != null)
            {
                request.APNSChannelRequest.PrivateKey = requestAPNSChannelRequest_aPNSChannelRequest_PrivateKey;
                requestAPNSChannelRequestIsNull       = false;
            }
            System.String requestAPNSChannelRequest_aPNSChannelRequest_TeamId = null;
            if (cmdletContext.APNSChannelRequest_TeamId != null)
            {
                requestAPNSChannelRequest_aPNSChannelRequest_TeamId = cmdletContext.APNSChannelRequest_TeamId;
            }
            if (requestAPNSChannelRequest_aPNSChannelRequest_TeamId != null)
            {
                request.APNSChannelRequest.TeamId = requestAPNSChannelRequest_aPNSChannelRequest_TeamId;
                requestAPNSChannelRequestIsNull   = false;
            }
            System.String requestAPNSChannelRequest_aPNSChannelRequest_TokenKey = null;
            if (cmdletContext.APNSChannelRequest_TokenKey != null)
            {
                requestAPNSChannelRequest_aPNSChannelRequest_TokenKey = cmdletContext.APNSChannelRequest_TokenKey;
            }
            if (requestAPNSChannelRequest_aPNSChannelRequest_TokenKey != null)
            {
                request.APNSChannelRequest.TokenKey = requestAPNSChannelRequest_aPNSChannelRequest_TokenKey;
                requestAPNSChannelRequestIsNull     = false;
            }
            System.String requestAPNSChannelRequest_aPNSChannelRequest_TokenKeyId = null;
            if (cmdletContext.APNSChannelRequest_TokenKeyId != null)
            {
                requestAPNSChannelRequest_aPNSChannelRequest_TokenKeyId = cmdletContext.APNSChannelRequest_TokenKeyId;
            }
            if (requestAPNSChannelRequest_aPNSChannelRequest_TokenKeyId != null)
            {
                request.APNSChannelRequest.TokenKeyId = requestAPNSChannelRequest_aPNSChannelRequest_TokenKeyId;
                requestAPNSChannelRequestIsNull       = false;
            }
            // determine if request.APNSChannelRequest should be set to null
            if (requestAPNSChannelRequestIsNull)
            {
                request.APNSChannelRequest = null;
            }
            if (cmdletContext.ApplicationId != null)
            {
                request.ApplicationId = cmdletContext.ApplicationId;
            }

            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);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Use to update the APNs channel for an app.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UpdateApnsChannel service method.</param>
        /// 
        /// <returns>The response from the UpdateApnsChannel 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 UpdateApnsChannelResponse UpdateApnsChannel(UpdateApnsChannelRequest request)
        {
            var marshaller = new UpdateApnsChannelRequestMarshaller();
            var unmarshaller = UpdateApnsChannelResponseUnmarshaller.Instance;

            return Invoke<UpdateApnsChannelRequest,UpdateApnsChannelResponse>(request, marshaller, unmarshaller);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateApnsChannel operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateApnsChannel 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 EndUpdateApnsChannel
        ///         operation.</returns>
        public IAsyncResult BeginUpdateApnsChannel(UpdateApnsChannelRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UpdateApnsChannelRequestMarshaller();
            var unmarshaller = UpdateApnsChannelResponseUnmarshaller.Instance;

            return BeginInvoke<UpdateApnsChannelRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateApnsChannel operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateApnsChannel 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<UpdateApnsChannelResponse> UpdateApnsChannelAsync(UpdateApnsChannelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateApnsChannelRequestMarshaller();
            var unmarshaller = UpdateApnsChannelResponseUnmarshaller.Instance;

            return InvokeAsync<UpdateApnsChannelRequest,UpdateApnsChannelResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }