Пример #1
0
 private Amazon.Pinpoint.Model.UpdateAdmChannelResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.UpdateAdmChannelRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "UpdateAdmChannel");
     try
     {
         #if DESKTOP
         return(client.UpdateAdmChannel(request));
         #elif CORECLR
         return(client.UpdateAdmChannelAsync(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.UpdateAdmChannelRequest();


            // populate ADMChannelRequest
            var requestADMChannelRequestIsNull = true;

            request.ADMChannelRequest = new Amazon.Pinpoint.Model.ADMChannelRequest();
            System.String requestADMChannelRequest_aDMChannelRequest_ClientId = null;
            if (cmdletContext.ADMChannelRequest_ClientId != null)
            {
                requestADMChannelRequest_aDMChannelRequest_ClientId = cmdletContext.ADMChannelRequest_ClientId;
            }
            if (requestADMChannelRequest_aDMChannelRequest_ClientId != null)
            {
                request.ADMChannelRequest.ClientId = requestADMChannelRequest_aDMChannelRequest_ClientId;
                requestADMChannelRequestIsNull     = false;
            }
            System.String requestADMChannelRequest_aDMChannelRequest_ClientSecret = null;
            if (cmdletContext.ADMChannelRequest_ClientSecret != null)
            {
                requestADMChannelRequest_aDMChannelRequest_ClientSecret = cmdletContext.ADMChannelRequest_ClientSecret;
            }
            if (requestADMChannelRequest_aDMChannelRequest_ClientSecret != null)
            {
                request.ADMChannelRequest.ClientSecret = requestADMChannelRequest_aDMChannelRequest_ClientSecret;
                requestADMChannelRequestIsNull         = false;
            }
            System.Boolean?requestADMChannelRequest_aDMChannelRequest_Enabled = null;
            if (cmdletContext.ADMChannelRequest_Enabled != null)
            {
                requestADMChannelRequest_aDMChannelRequest_Enabled = cmdletContext.ADMChannelRequest_Enabled.Value;
            }
            if (requestADMChannelRequest_aDMChannelRequest_Enabled != null)
            {
                request.ADMChannelRequest.Enabled = requestADMChannelRequest_aDMChannelRequest_Enabled.Value;
                requestADMChannelRequestIsNull    = false;
            }
            // determine if request.ADMChannelRequest should be set to null
            if (requestADMChannelRequestIsNull)
            {
                request.ADMChannelRequest = 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);
        }