Exemplo n.º 1
0
 private Amazon.GroundStation.Model.CreateConfigResponse CallAWSServiceOperation(IAmazonGroundStation client, Amazon.GroundStation.Model.CreateConfigRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Ground Station", "CreateConfig");
     try
     {
         #if DESKTOP
         return(client.CreateConfig(request));
         #elif CORECLR
         return(client.CreateConfigAsync(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.GroundStation.Model.CreateConfigRequest();


            // populate ConfigData
            var requestConfigDataIsNull = true;

            request.ConfigData = new Amazon.GroundStation.Model.ConfigTypeData();
            Amazon.GroundStation.Model.AntennaDownlinkConfig requestConfigData_configData_AntennaDownlinkConfig = null;
            if (cmdletContext.ConfigData_AntennaDownlinkConfig != null)
            {
                requestConfigData_configData_AntennaDownlinkConfig = cmdletContext.ConfigData_AntennaDownlinkConfig;
            }
            if (requestConfigData_configData_AntennaDownlinkConfig != null)
            {
                request.ConfigData.AntennaDownlinkConfig = requestConfigData_configData_AntennaDownlinkConfig;
                requestConfigDataIsNull = false;
            }
            Amazon.GroundStation.Model.AntennaDownlinkDemodDecodeConfig requestConfigData_configData_AntennaDownlinkDemodDecodeConfig = null;
            if (cmdletContext.ConfigData_AntennaDownlinkDemodDecodeConfig != null)
            {
                requestConfigData_configData_AntennaDownlinkDemodDecodeConfig = cmdletContext.ConfigData_AntennaDownlinkDemodDecodeConfig;
            }
            if (requestConfigData_configData_AntennaDownlinkDemodDecodeConfig != null)
            {
                request.ConfigData.AntennaDownlinkDemodDecodeConfig = requestConfigData_configData_AntennaDownlinkDemodDecodeConfig;
                requestConfigDataIsNull = false;
            }
            Amazon.GroundStation.Model.AntennaUplinkConfig requestConfigData_configData_AntennaUplinkConfig = null;
            if (cmdletContext.ConfigData_AntennaUplinkConfig != null)
            {
                requestConfigData_configData_AntennaUplinkConfig = cmdletContext.ConfigData_AntennaUplinkConfig;
            }
            if (requestConfigData_configData_AntennaUplinkConfig != null)
            {
                request.ConfigData.AntennaUplinkConfig = requestConfigData_configData_AntennaUplinkConfig;
                requestConfigDataIsNull = false;
            }
            Amazon.GroundStation.Model.DataflowEndpointConfig requestConfigData_configData_DataflowEndpointConfig = null;
            if (cmdletContext.ConfigData_DataflowEndpointConfig != null)
            {
                requestConfigData_configData_DataflowEndpointConfig = cmdletContext.ConfigData_DataflowEndpointConfig;
            }
            if (requestConfigData_configData_DataflowEndpointConfig != null)
            {
                request.ConfigData.DataflowEndpointConfig = requestConfigData_configData_DataflowEndpointConfig;
                requestConfigDataIsNull = false;
            }
            Amazon.GroundStation.Model.TrackingConfig requestConfigData_configData_TrackingConfig = null;
            if (cmdletContext.ConfigData_TrackingConfig != null)
            {
                requestConfigData_configData_TrackingConfig = cmdletContext.ConfigData_TrackingConfig;
            }
            if (requestConfigData_configData_TrackingConfig != null)
            {
                request.ConfigData.TrackingConfig = requestConfigData_configData_TrackingConfig;
                requestConfigDataIsNull           = false;
            }
            Amazon.GroundStation.Model.UplinkEchoConfig requestConfigData_configData_UplinkEchoConfig = null;
            if (cmdletContext.ConfigData_UplinkEchoConfig != null)
            {
                requestConfigData_configData_UplinkEchoConfig = cmdletContext.ConfigData_UplinkEchoConfig;
            }
            if (requestConfigData_configData_UplinkEchoConfig != null)
            {
                request.ConfigData.UplinkEchoConfig = requestConfigData_configData_UplinkEchoConfig;
                requestConfigDataIsNull             = false;
            }
            Amazon.GroundStation.Model.S3RecordingConfig requestConfigData_configData_S3RecordingConfig = null;

            // populate S3RecordingConfig
            var requestConfigData_configData_S3RecordingConfigIsNull = true;

            requestConfigData_configData_S3RecordingConfig = new Amazon.GroundStation.Model.S3RecordingConfig();
            System.String requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_BucketArn = null;
            if (cmdletContext.S3RecordingConfig_BucketArn != null)
            {
                requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_BucketArn = cmdletContext.S3RecordingConfig_BucketArn;
            }
            if (requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_BucketArn != null)
            {
                requestConfigData_configData_S3RecordingConfig.BucketArn = requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_BucketArn;
                requestConfigData_configData_S3RecordingConfigIsNull     = false;
            }
            System.String requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_Prefix = null;
            if (cmdletContext.S3RecordingConfig_Prefix != null)
            {
                requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_Prefix = cmdletContext.S3RecordingConfig_Prefix;
            }
            if (requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_Prefix != null)
            {
                requestConfigData_configData_S3RecordingConfig.Prefix = requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_Prefix;
                requestConfigData_configData_S3RecordingConfigIsNull  = false;
            }
            System.String requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_RoleArn = null;
            if (cmdletContext.S3RecordingConfig_RoleArn != null)
            {
                requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_RoleArn = cmdletContext.S3RecordingConfig_RoleArn;
            }
            if (requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_RoleArn != null)
            {
                requestConfigData_configData_S3RecordingConfig.RoleArn = requestConfigData_configData_S3RecordingConfig_s3RecordingConfig_RoleArn;
                requestConfigData_configData_S3RecordingConfigIsNull   = false;
            }
            // determine if requestConfigData_configData_S3RecordingConfig should be set to null
            if (requestConfigData_configData_S3RecordingConfigIsNull)
            {
                requestConfigData_configData_S3RecordingConfig = null;
            }
            if (requestConfigData_configData_S3RecordingConfig != null)
            {
                request.ConfigData.S3RecordingConfig = requestConfigData_configData_S3RecordingConfig;
                requestConfigDataIsNull = false;
            }
            // determine if request.ConfigData should be set to null
            if (requestConfigDataIsNull)
            {
                request.ConfigData = null;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

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