Exemplo n.º 1
0
 private Amazon.Pinpoint.Model.PutEventStreamResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.PutEventStreamRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "PutEventStream");
     try
     {
         #if DESKTOP
         return(client.PutEventStream(request));
         #elif CORECLR
         return(client.PutEventStreamAsync(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.PutEventStreamRequest();

            if (cmdletContext.ApplicationId != null)
            {
                request.ApplicationId = cmdletContext.ApplicationId;
            }

            // populate WriteEventStream
            var requestWriteEventStreamIsNull = true;

            request.WriteEventStream = new Amazon.Pinpoint.Model.WriteEventStream();
            System.String requestWriteEventStream_writeEventStream_DestinationStreamArn = null;
            if (cmdletContext.WriteEventStream_DestinationStreamArn != null)
            {
                requestWriteEventStream_writeEventStream_DestinationStreamArn = cmdletContext.WriteEventStream_DestinationStreamArn;
            }
            if (requestWriteEventStream_writeEventStream_DestinationStreamArn != null)
            {
                request.WriteEventStream.DestinationStreamArn = requestWriteEventStream_writeEventStream_DestinationStreamArn;
                requestWriteEventStreamIsNull = false;
            }
            System.String requestWriteEventStream_writeEventStream_RoleArn = null;
            if (cmdletContext.WriteEventStream_RoleArn != null)
            {
                requestWriteEventStream_writeEventStream_RoleArn = cmdletContext.WriteEventStream_RoleArn;
            }
            if (requestWriteEventStream_writeEventStream_RoleArn != null)
            {
                request.WriteEventStream.RoleArn = requestWriteEventStream_writeEventStream_RoleArn;
                requestWriteEventStreamIsNull    = false;
            }
            // determine if request.WriteEventStream should be set to null
            if (requestWriteEventStreamIsNull)
            {
                request.WriteEventStream = 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);
        }