Ejemplo n.º 1
0
 private Amazon.Pinpoint.Model.UpdateApnsSandboxChannelResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.UpdateApnsSandboxChannelRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "UpdateApnsSandboxChannel");
     try
     {
         #if DESKTOP
         return(client.UpdateApnsSandboxChannel(request));
         #elif CORECLR
         return(client.UpdateApnsSandboxChannelAsync(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;
     }
 }
Ejemplo n.º 2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Pinpoint.Model.UpdateApnsSandboxChannelRequest();


            // populate APNSSandboxChannelRequest
            var requestAPNSSandboxChannelRequestIsNull = true;

            request.APNSSandboxChannelRequest = new Amazon.Pinpoint.Model.APNSSandboxChannelRequest();
            System.String requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_BundleId = null;
            if (cmdletContext.APNSSandboxChannelRequest_BundleId != null)
            {
                requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_BundleId = cmdletContext.APNSSandboxChannelRequest_BundleId;
            }
            if (requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_BundleId != null)
            {
                request.APNSSandboxChannelRequest.BundleId = requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_BundleId;
                requestAPNSSandboxChannelRequestIsNull     = false;
            }
            System.String requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_Certificate = null;
            if (cmdletContext.APNSSandboxChannelRequest_Certificate != null)
            {
                requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_Certificate = cmdletContext.APNSSandboxChannelRequest_Certificate;
            }
            if (requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_Certificate != null)
            {
                request.APNSSandboxChannelRequest.Certificate = requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_Certificate;
                requestAPNSSandboxChannelRequestIsNull        = false;
            }
            System.String requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_DefaultAuthenticationMethod = null;
            if (cmdletContext.APNSSandboxChannelRequest_DefaultAuthenticationMethod != null)
            {
                requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_DefaultAuthenticationMethod = cmdletContext.APNSSandboxChannelRequest_DefaultAuthenticationMethod;
            }
            if (requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_DefaultAuthenticationMethod != null)
            {
                request.APNSSandboxChannelRequest.DefaultAuthenticationMethod = requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_DefaultAuthenticationMethod;
                requestAPNSSandboxChannelRequestIsNull = false;
            }
            System.Boolean?requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_Enabled = null;
            if (cmdletContext.APNSSandboxChannelRequest_Enabled != null)
            {
                requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_Enabled = cmdletContext.APNSSandboxChannelRequest_Enabled.Value;
            }
            if (requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_Enabled != null)
            {
                request.APNSSandboxChannelRequest.Enabled = requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_Enabled.Value;
                requestAPNSSandboxChannelRequestIsNull    = false;
            }
            System.String requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_PrivateKey = null;
            if (cmdletContext.APNSSandboxChannelRequest_PrivateKey != null)
            {
                requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_PrivateKey = cmdletContext.APNSSandboxChannelRequest_PrivateKey;
            }
            if (requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_PrivateKey != null)
            {
                request.APNSSandboxChannelRequest.PrivateKey = requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_PrivateKey;
                requestAPNSSandboxChannelRequestIsNull       = false;
            }
            System.String requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TeamId = null;
            if (cmdletContext.APNSSandboxChannelRequest_TeamId != null)
            {
                requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TeamId = cmdletContext.APNSSandboxChannelRequest_TeamId;
            }
            if (requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TeamId != null)
            {
                request.APNSSandboxChannelRequest.TeamId = requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TeamId;
                requestAPNSSandboxChannelRequestIsNull   = false;
            }
            System.String requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TokenKey = null;
            if (cmdletContext.APNSSandboxChannelRequest_TokenKey != null)
            {
                requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TokenKey = cmdletContext.APNSSandboxChannelRequest_TokenKey;
            }
            if (requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TokenKey != null)
            {
                request.APNSSandboxChannelRequest.TokenKey = requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TokenKey;
                requestAPNSSandboxChannelRequestIsNull     = false;
            }
            System.String requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TokenKeyId = null;
            if (cmdletContext.APNSSandboxChannelRequest_TokenKeyId != null)
            {
                requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TokenKeyId = cmdletContext.APNSSandboxChannelRequest_TokenKeyId;
            }
            if (requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TokenKeyId != null)
            {
                request.APNSSandboxChannelRequest.TokenKeyId = requestAPNSSandboxChannelRequest_aPNSSandboxChannelRequest_TokenKeyId;
                requestAPNSSandboxChannelRequestIsNull       = false;
            }
            // determine if request.APNSSandboxChannelRequest should be set to null
            if (requestAPNSSandboxChannelRequestIsNull)
            {
                request.APNSSandboxChannelRequest = 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);
        }