Ejemplo n.º 1
0
 private Amazon.KinesisAnalytics.Model.AddApplicationCloudWatchLoggingOptionResponse CallAWSServiceOperation(IAmazonKinesisAnalytics client, Amazon.KinesisAnalytics.Model.AddApplicationCloudWatchLoggingOptionRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis Analytics", "AddApplicationCloudWatchLoggingOption");
     try
     {
         #if DESKTOP
         return(client.AddApplicationCloudWatchLoggingOption(request));
         #elif CORECLR
         return(client.AddApplicationCloudWatchLoggingOptionAsync(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.KinesisAnalytics.Model.AddApplicationCloudWatchLoggingOptionRequest();

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

            // populate CloudWatchLoggingOption
            var requestCloudWatchLoggingOptionIsNull = true;

            request.CloudWatchLoggingOption = new Amazon.KinesisAnalytics.Model.CloudWatchLoggingOption();
            System.String requestCloudWatchLoggingOption_cloudWatchLoggingOption_LogStreamARN = null;
            if (cmdletContext.CloudWatchLoggingOption_LogStreamARN != null)
            {
                requestCloudWatchLoggingOption_cloudWatchLoggingOption_LogStreamARN = cmdletContext.CloudWatchLoggingOption_LogStreamARN;
            }
            if (requestCloudWatchLoggingOption_cloudWatchLoggingOption_LogStreamARN != null)
            {
                request.CloudWatchLoggingOption.LogStreamARN = requestCloudWatchLoggingOption_cloudWatchLoggingOption_LogStreamARN;
                requestCloudWatchLoggingOptionIsNull         = false;
            }
            System.String requestCloudWatchLoggingOption_cloudWatchLoggingOption_RoleARN = null;
            if (cmdletContext.CloudWatchLoggingOption_RoleARN != null)
            {
                requestCloudWatchLoggingOption_cloudWatchLoggingOption_RoleARN = cmdletContext.CloudWatchLoggingOption_RoleARN;
            }
            if (requestCloudWatchLoggingOption_cloudWatchLoggingOption_RoleARN != null)
            {
                request.CloudWatchLoggingOption.RoleARN = requestCloudWatchLoggingOption_cloudWatchLoggingOption_RoleARN;
                requestCloudWatchLoggingOptionIsNull    = false;
            }
            // determine if request.CloudWatchLoggingOption should be set to null
            if (requestCloudWatchLoggingOptionIsNull)
            {
                request.CloudWatchLoggingOption = null;
            }
            if (cmdletContext.CurrentApplicationVersionId != null)
            {
                request.CurrentApplicationVersionId = cmdletContext.CurrentApplicationVersionId.Value;
            }

            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);
        }