Exemplo n.º 1
0
 private Amazon.Glue.Model.GetSchemaVersionsDiffResponse CallAWSServiceOperation(IAmazonGlue client, Amazon.Glue.Model.GetSchemaVersionsDiffRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Glue", "GetSchemaVersionsDiff");
     try
     {
         #if DESKTOP
         return(client.GetSchemaVersionsDiff(request));
         #elif CORECLR
         return(client.GetSchemaVersionsDiffAsync(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.Glue.Model.GetSchemaVersionsDiffRequest();


            // populate FirstSchemaVersionNumber
            var requestFirstSchemaVersionNumberIsNull = true;

            request.FirstSchemaVersionNumber = new Amazon.Glue.Model.SchemaVersionNumber();
            System.Boolean?requestFirstSchemaVersionNumber_firstSchemaVersionNumber_LatestVersion = null;
            if (cmdletContext.FirstSchemaVersionNumber_LatestVersion != null)
            {
                requestFirstSchemaVersionNumber_firstSchemaVersionNumber_LatestVersion = cmdletContext.FirstSchemaVersionNumber_LatestVersion.Value;
            }
            if (requestFirstSchemaVersionNumber_firstSchemaVersionNumber_LatestVersion != null)
            {
                request.FirstSchemaVersionNumber.LatestVersion = requestFirstSchemaVersionNumber_firstSchemaVersionNumber_LatestVersion.Value;
                requestFirstSchemaVersionNumberIsNull          = false;
            }
            System.Int64?requestFirstSchemaVersionNumber_firstSchemaVersionNumber_VersionNumber = null;
            if (cmdletContext.FirstSchemaVersionNumber_VersionNumber != null)
            {
                requestFirstSchemaVersionNumber_firstSchemaVersionNumber_VersionNumber = cmdletContext.FirstSchemaVersionNumber_VersionNumber.Value;
            }
            if (requestFirstSchemaVersionNumber_firstSchemaVersionNumber_VersionNumber != null)
            {
                request.FirstSchemaVersionNumber.VersionNumber = requestFirstSchemaVersionNumber_firstSchemaVersionNumber_VersionNumber.Value;
                requestFirstSchemaVersionNumberIsNull          = false;
            }
            // determine if request.FirstSchemaVersionNumber should be set to null
            if (requestFirstSchemaVersionNumberIsNull)
            {
                request.FirstSchemaVersionNumber = null;
            }
            if (cmdletContext.SchemaDiffType != null)
            {
                request.SchemaDiffType = cmdletContext.SchemaDiffType;
            }

            // populate SchemaId
            var requestSchemaIdIsNull = true;

            request.SchemaId = new Amazon.Glue.Model.SchemaId();
            System.String requestSchemaId_schemaId_RegistryName = null;
            if (cmdletContext.SchemaId_RegistryName != null)
            {
                requestSchemaId_schemaId_RegistryName = cmdletContext.SchemaId_RegistryName;
            }
            if (requestSchemaId_schemaId_RegistryName != null)
            {
                request.SchemaId.RegistryName = requestSchemaId_schemaId_RegistryName;
                requestSchemaIdIsNull         = false;
            }
            System.String requestSchemaId_schemaId_SchemaArn = null;
            if (cmdletContext.SchemaId_SchemaArn != null)
            {
                requestSchemaId_schemaId_SchemaArn = cmdletContext.SchemaId_SchemaArn;
            }
            if (requestSchemaId_schemaId_SchemaArn != null)
            {
                request.SchemaId.SchemaArn = requestSchemaId_schemaId_SchemaArn;
                requestSchemaIdIsNull      = false;
            }
            System.String requestSchemaId_schemaId_SchemaName = null;
            if (cmdletContext.SchemaId_SchemaName != null)
            {
                requestSchemaId_schemaId_SchemaName = cmdletContext.SchemaId_SchemaName;
            }
            if (requestSchemaId_schemaId_SchemaName != null)
            {
                request.SchemaId.SchemaName = requestSchemaId_schemaId_SchemaName;
                requestSchemaIdIsNull       = false;
            }
            // determine if request.SchemaId should be set to null
            if (requestSchemaIdIsNull)
            {
                request.SchemaId = null;
            }

            // populate SecondSchemaVersionNumber
            var requestSecondSchemaVersionNumberIsNull = true;

            request.SecondSchemaVersionNumber = new Amazon.Glue.Model.SchemaVersionNumber();
            System.Boolean?requestSecondSchemaVersionNumber_secondSchemaVersionNumber_LatestVersion = null;
            if (cmdletContext.SecondSchemaVersionNumber_LatestVersion != null)
            {
                requestSecondSchemaVersionNumber_secondSchemaVersionNumber_LatestVersion = cmdletContext.SecondSchemaVersionNumber_LatestVersion.Value;
            }
            if (requestSecondSchemaVersionNumber_secondSchemaVersionNumber_LatestVersion != null)
            {
                request.SecondSchemaVersionNumber.LatestVersion = requestSecondSchemaVersionNumber_secondSchemaVersionNumber_LatestVersion.Value;
                requestSecondSchemaVersionNumberIsNull          = false;
            }
            System.Int64?requestSecondSchemaVersionNumber_secondSchemaVersionNumber_VersionNumber = null;
            if (cmdletContext.SecondSchemaVersionNumber_VersionNumber != null)
            {
                requestSecondSchemaVersionNumber_secondSchemaVersionNumber_VersionNumber = cmdletContext.SecondSchemaVersionNumber_VersionNumber.Value;
            }
            if (requestSecondSchemaVersionNumber_secondSchemaVersionNumber_VersionNumber != null)
            {
                request.SecondSchemaVersionNumber.VersionNumber = requestSecondSchemaVersionNumber_secondSchemaVersionNumber_VersionNumber.Value;
                requestSecondSchemaVersionNumberIsNull          = false;
            }
            // determine if request.SecondSchemaVersionNumber should be set to null
            if (requestSecondSchemaVersionNumberIsNull)
            {
                request.SecondSchemaVersionNumber = 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);
        }