Beispiel #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.KinesisAnalyticsV2.Model.UpdateApplicationMaintenanceConfigurationRequest();


            // populate ApplicationMaintenanceConfigurationUpdate
            var requestApplicationMaintenanceConfigurationUpdateIsNull = true;

            request.ApplicationMaintenanceConfigurationUpdate = new Amazon.KinesisAnalyticsV2.Model.ApplicationMaintenanceConfigurationUpdate();
            System.String requestApplicationMaintenanceConfigurationUpdate_applicationMaintenanceConfigurationUpdate_ApplicationMaintenanceWindowStartTimeUpdate = null;
            if (cmdletContext.ApplicationMaintenanceConfigurationUpdate_ApplicationMaintenanceWindowStartTimeUpdate != null)
            {
                requestApplicationMaintenanceConfigurationUpdate_applicationMaintenanceConfigurationUpdate_ApplicationMaintenanceWindowStartTimeUpdate = cmdletContext.ApplicationMaintenanceConfigurationUpdate_ApplicationMaintenanceWindowStartTimeUpdate;
            }
            if (requestApplicationMaintenanceConfigurationUpdate_applicationMaintenanceConfigurationUpdate_ApplicationMaintenanceWindowStartTimeUpdate != null)
            {
                request.ApplicationMaintenanceConfigurationUpdate.ApplicationMaintenanceWindowStartTimeUpdate = requestApplicationMaintenanceConfigurationUpdate_applicationMaintenanceConfigurationUpdate_ApplicationMaintenanceWindowStartTimeUpdate;
                requestApplicationMaintenanceConfigurationUpdateIsNull = false;
            }
            // determine if request.ApplicationMaintenanceConfigurationUpdate should be set to null
            if (requestApplicationMaintenanceConfigurationUpdateIsNull)
            {
                request.ApplicationMaintenanceConfigurationUpdate = null;
            }
            if (cmdletContext.ApplicationName != null)
            {
                request.ApplicationName = cmdletContext.ApplicationName;
            }

            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);
        }
Beispiel #2
0
 private Amazon.KinesisAnalyticsV2.Model.UpdateApplicationMaintenanceConfigurationResponse CallAWSServiceOperation(IAmazonKinesisAnalyticsV2 client, Amazon.KinesisAnalyticsV2.Model.UpdateApplicationMaintenanceConfigurationRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis Analytics V2", "UpdateApplicationMaintenanceConfiguration");
     try
     {
         #if DESKTOP
         return(client.UpdateApplicationMaintenanceConfiguration(request));
         #elif CORECLR
         return(client.UpdateApplicationMaintenanceConfigurationAsync(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;
     }
 }