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


            // populate APNSVoipSandboxChannelRequest
            var requestAPNSVoipSandboxChannelRequestIsNull = true;

            request.APNSVoipSandboxChannelRequest = new Amazon.Pinpoint.Model.APNSVoipSandboxChannelRequest();
            System.String requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_BundleId = null;
            if (cmdletContext.APNSVoipSandboxChannelRequest_BundleId != null)
            {
                requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_BundleId = cmdletContext.APNSVoipSandboxChannelRequest_BundleId;
            }
            if (requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_BundleId != null)
            {
                request.APNSVoipSandboxChannelRequest.BundleId = requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_BundleId;
                requestAPNSVoipSandboxChannelRequestIsNull     = false;
            }
            System.String requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_Certificate = null;
            if (cmdletContext.APNSVoipSandboxChannelRequest_Certificate != null)
            {
                requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_Certificate = cmdletContext.APNSVoipSandboxChannelRequest_Certificate;
            }
            if (requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_Certificate != null)
            {
                request.APNSVoipSandboxChannelRequest.Certificate = requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_Certificate;
                requestAPNSVoipSandboxChannelRequestIsNull        = false;
            }
            System.String requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_DefaultAuthenticationMethod = null;
            if (cmdletContext.APNSVoipSandboxChannelRequest_DefaultAuthenticationMethod != null)
            {
                requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_DefaultAuthenticationMethod = cmdletContext.APNSVoipSandboxChannelRequest_DefaultAuthenticationMethod;
            }
            if (requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_DefaultAuthenticationMethod != null)
            {
                request.APNSVoipSandboxChannelRequest.DefaultAuthenticationMethod = requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_DefaultAuthenticationMethod;
                requestAPNSVoipSandboxChannelRequestIsNull = false;
            }
            System.Boolean?requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_Enabled = null;
            if (cmdletContext.APNSVoipSandboxChannelRequest_Enabled != null)
            {
                requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_Enabled = cmdletContext.APNSVoipSandboxChannelRequest_Enabled.Value;
            }
            if (requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_Enabled != null)
            {
                request.APNSVoipSandboxChannelRequest.Enabled = requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_Enabled.Value;
                requestAPNSVoipSandboxChannelRequestIsNull    = false;
            }
            System.String requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_PrivateKey = null;
            if (cmdletContext.APNSVoipSandboxChannelRequest_PrivateKey != null)
            {
                requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_PrivateKey = cmdletContext.APNSVoipSandboxChannelRequest_PrivateKey;
            }
            if (requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_PrivateKey != null)
            {
                request.APNSVoipSandboxChannelRequest.PrivateKey = requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_PrivateKey;
                requestAPNSVoipSandboxChannelRequestIsNull       = false;
            }
            System.String requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TeamId = null;
            if (cmdletContext.APNSVoipSandboxChannelRequest_TeamId != null)
            {
                requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TeamId = cmdletContext.APNSVoipSandboxChannelRequest_TeamId;
            }
            if (requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TeamId != null)
            {
                request.APNSVoipSandboxChannelRequest.TeamId = requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TeamId;
                requestAPNSVoipSandboxChannelRequestIsNull   = false;
            }
            System.String requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TokenKey = null;
            if (cmdletContext.APNSVoipSandboxChannelRequest_TokenKey != null)
            {
                requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TokenKey = cmdletContext.APNSVoipSandboxChannelRequest_TokenKey;
            }
            if (requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TokenKey != null)
            {
                request.APNSVoipSandboxChannelRequest.TokenKey = requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TokenKey;
                requestAPNSVoipSandboxChannelRequestIsNull     = false;
            }
            System.String requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TokenKeyId = null;
            if (cmdletContext.APNSVoipSandboxChannelRequest_TokenKeyId != null)
            {
                requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TokenKeyId = cmdletContext.APNSVoipSandboxChannelRequest_TokenKeyId;
            }
            if (requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TokenKeyId != null)
            {
                request.APNSVoipSandboxChannelRequest.TokenKeyId = requestAPNSVoipSandboxChannelRequest_aPNSVoipSandboxChannelRequest_TokenKeyId;
                requestAPNSVoipSandboxChannelRequestIsNull       = false;
            }
            // determine if request.APNSVoipSandboxChannelRequest should be set to null
            if (requestAPNSVoipSandboxChannelRequestIsNull)
            {
                request.APNSVoipSandboxChannelRequest = 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);
        }