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


            // populate CsvClassifier
            var requestCsvClassifierIsNull = true;

            request.CsvClassifier = new Amazon.Glue.Model.UpdateCsvClassifierRequest();
            System.Boolean?requestCsvClassifier_csvClassifier_AllowSingleColumn = null;
            if (cmdletContext.CsvClassifier_AllowSingleColumn != null)
            {
                requestCsvClassifier_csvClassifier_AllowSingleColumn = cmdletContext.CsvClassifier_AllowSingleColumn.Value;
            }
            if (requestCsvClassifier_csvClassifier_AllowSingleColumn != null)
            {
                request.CsvClassifier.AllowSingleColumn = requestCsvClassifier_csvClassifier_AllowSingleColumn.Value;
                requestCsvClassifierIsNull = false;
            }
            Amazon.Glue.CsvHeaderOption requestCsvClassifier_csvClassifier_ContainsHeader = null;
            if (cmdletContext.CsvClassifier_ContainsHeader != null)
            {
                requestCsvClassifier_csvClassifier_ContainsHeader = cmdletContext.CsvClassifier_ContainsHeader;
            }
            if (requestCsvClassifier_csvClassifier_ContainsHeader != null)
            {
                request.CsvClassifier.ContainsHeader = requestCsvClassifier_csvClassifier_ContainsHeader;
                requestCsvClassifierIsNull           = false;
            }
            System.String requestCsvClassifier_csvClassifier_Delimiter = null;
            if (cmdletContext.CsvClassifier_Delimiter != null)
            {
                requestCsvClassifier_csvClassifier_Delimiter = cmdletContext.CsvClassifier_Delimiter;
            }
            if (requestCsvClassifier_csvClassifier_Delimiter != null)
            {
                request.CsvClassifier.Delimiter = requestCsvClassifier_csvClassifier_Delimiter;
                requestCsvClassifierIsNull      = false;
            }
            System.Boolean?requestCsvClassifier_csvClassifier_DisableValueTrimming = null;
            if (cmdletContext.CsvClassifier_DisableValueTrimming != null)
            {
                requestCsvClassifier_csvClassifier_DisableValueTrimming = cmdletContext.CsvClassifier_DisableValueTrimming.Value;
            }
            if (requestCsvClassifier_csvClassifier_DisableValueTrimming != null)
            {
                request.CsvClassifier.DisableValueTrimming = requestCsvClassifier_csvClassifier_DisableValueTrimming.Value;
                requestCsvClassifierIsNull = false;
            }
            List <System.String> requestCsvClassifier_csvClassifier_Header = null;

            if (cmdletContext.CsvClassifier_Header != null)
            {
                requestCsvClassifier_csvClassifier_Header = cmdletContext.CsvClassifier_Header;
            }
            if (requestCsvClassifier_csvClassifier_Header != null)
            {
                request.CsvClassifier.Header = requestCsvClassifier_csvClassifier_Header;
                requestCsvClassifierIsNull   = false;
            }
            System.String requestCsvClassifier_csvClassifier_Name = null;
            if (cmdletContext.CsvClassifier_Name != null)
            {
                requestCsvClassifier_csvClassifier_Name = cmdletContext.CsvClassifier_Name;
            }
            if (requestCsvClassifier_csvClassifier_Name != null)
            {
                request.CsvClassifier.Name = requestCsvClassifier_csvClassifier_Name;
                requestCsvClassifierIsNull = false;
            }
            System.String requestCsvClassifier_csvClassifier_QuoteSymbol = null;
            if (cmdletContext.CsvClassifier_QuoteSymbol != null)
            {
                requestCsvClassifier_csvClassifier_QuoteSymbol = cmdletContext.CsvClassifier_QuoteSymbol;
            }
            if (requestCsvClassifier_csvClassifier_QuoteSymbol != null)
            {
                request.CsvClassifier.QuoteSymbol = requestCsvClassifier_csvClassifier_QuoteSymbol;
                requestCsvClassifierIsNull        = false;
            }
            // determine if request.CsvClassifier should be set to null
            if (requestCsvClassifierIsNull)
            {
                request.CsvClassifier = null;
            }
            if (cmdletContext.GrokClassifier != null)
            {
                request.GrokClassifier = cmdletContext.GrokClassifier;
            }

            // populate JsonClassifier
            var requestJsonClassifierIsNull = true;

            request.JsonClassifier = new Amazon.Glue.Model.UpdateJsonClassifierRequest();
            System.String requestJsonClassifier_jsonClassifier_JsonPath = null;
            if (cmdletContext.JsonClassifier_JsonPath != null)
            {
                requestJsonClassifier_jsonClassifier_JsonPath = cmdletContext.JsonClassifier_JsonPath;
            }
            if (requestJsonClassifier_jsonClassifier_JsonPath != null)
            {
                request.JsonClassifier.JsonPath = requestJsonClassifier_jsonClassifier_JsonPath;
                requestJsonClassifierIsNull     = false;
            }
            System.String requestJsonClassifier_jsonClassifier_Name = null;
            if (cmdletContext.JsonClassifier_Name != null)
            {
                requestJsonClassifier_jsonClassifier_Name = cmdletContext.JsonClassifier_Name;
            }
            if (requestJsonClassifier_jsonClassifier_Name != null)
            {
                request.JsonClassifier.Name = requestJsonClassifier_jsonClassifier_Name;
                requestJsonClassifierIsNull = false;
            }
            // determine if request.JsonClassifier should be set to null
            if (requestJsonClassifierIsNull)
            {
                request.JsonClassifier = null;
            }
            if (cmdletContext.XMLClassifier != null)
            {
                request.XMLClassifier = cmdletContext.XMLClassifier;
            }

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