Example #1
0
 /// <summary>
 /// Paginator for ListMLTransforms operation
 ///</summary>
 public IListMLTransformsPaginator ListMLTransforms(ListMLTransformsRequest request)
 {
     return(new ListMLTransformsPaginator(this.client, request));
 }
 private Amazon.Glue.Model.ListMLTransformsResponse CallAWSServiceOperation(IAmazonGlue client, Amazon.Glue.Model.ListMLTransformsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Glue", "ListMLTransforms");
     try
     {
         #if DESKTOP
         return(client.ListMLTransforms(request));
         #elif CORECLR
         return(client.ListMLTransformsAsync(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;
     }
 }
 internal ListMLTransformsPaginator(IAmazonGlue client, ListMLTransformsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext      = context as CmdletContext;
            var useParameterSelect = this.Select.StartsWith("^");

            // create request and set iteration invariants
            var request = new Amazon.Glue.Model.ListMLTransformsRequest();


            // populate Filter
            var requestFilterIsNull = true;

            request.Filter = new Amazon.Glue.Model.TransformFilterCriteria();
            System.DateTime?requestFilter_filter_CreatedAfter = null;
            if (cmdletContext.Filter_CreatedAfter != null)
            {
                requestFilter_filter_CreatedAfter = cmdletContext.Filter_CreatedAfter.Value;
            }
            if (requestFilter_filter_CreatedAfter != null)
            {
                request.Filter.CreatedAfter = requestFilter_filter_CreatedAfter.Value;
                requestFilterIsNull         = false;
            }
            System.DateTime?requestFilter_filter_CreatedBefore = null;
            if (cmdletContext.Filter_CreatedBefore != null)
            {
                requestFilter_filter_CreatedBefore = cmdletContext.Filter_CreatedBefore.Value;
            }
            if (requestFilter_filter_CreatedBefore != null)
            {
                request.Filter.CreatedBefore = requestFilter_filter_CreatedBefore.Value;
                requestFilterIsNull          = false;
            }
            System.String requestFilter_filter_GlueVersion = null;
            if (cmdletContext.Filter_GlueVersion != null)
            {
                requestFilter_filter_GlueVersion = cmdletContext.Filter_GlueVersion;
            }
            if (requestFilter_filter_GlueVersion != null)
            {
                request.Filter.GlueVersion = requestFilter_filter_GlueVersion;
                requestFilterIsNull        = false;
            }
            System.DateTime?requestFilter_filter_LastModifiedAfter = null;
            if (cmdletContext.Filter_LastModifiedAfter != null)
            {
                requestFilter_filter_LastModifiedAfter = cmdletContext.Filter_LastModifiedAfter.Value;
            }
            if (requestFilter_filter_LastModifiedAfter != null)
            {
                request.Filter.LastModifiedAfter = requestFilter_filter_LastModifiedAfter.Value;
                requestFilterIsNull = false;
            }
            System.DateTime?requestFilter_filter_LastModifiedBefore = null;
            if (cmdletContext.Filter_LastModifiedBefore != null)
            {
                requestFilter_filter_LastModifiedBefore = cmdletContext.Filter_LastModifiedBefore.Value;
            }
            if (requestFilter_filter_LastModifiedBefore != null)
            {
                request.Filter.LastModifiedBefore = requestFilter_filter_LastModifiedBefore.Value;
                requestFilterIsNull = false;
            }
            System.String requestFilter_filter_Name = null;
            if (cmdletContext.Filter_Name != null)
            {
                requestFilter_filter_Name = cmdletContext.Filter_Name;
            }
            if (requestFilter_filter_Name != null)
            {
                request.Filter.Name = requestFilter_filter_Name;
                requestFilterIsNull = false;
            }
            List <Amazon.Glue.Model.SchemaColumn> requestFilter_filter_Schema = null;

            if (cmdletContext.Filter_Schema != null)
            {
                requestFilter_filter_Schema = cmdletContext.Filter_Schema;
            }
            if (requestFilter_filter_Schema != null)
            {
                request.Filter.Schema = requestFilter_filter_Schema;
                requestFilterIsNull   = false;
            }
            Amazon.Glue.TransformStatusType requestFilter_filter_Status = null;
            if (cmdletContext.Filter_Status != null)
            {
                requestFilter_filter_Status = cmdletContext.Filter_Status;
            }
            if (requestFilter_filter_Status != null)
            {
                request.Filter.Status = requestFilter_filter_Status;
                requestFilterIsNull   = false;
            }
            Amazon.Glue.TransformType requestFilter_filter_TransformType = null;
            if (cmdletContext.Filter_TransformType != null)
            {
                requestFilter_filter_TransformType = cmdletContext.Filter_TransformType;
            }
            if (requestFilter_filter_TransformType != null)
            {
                request.Filter.TransformType = requestFilter_filter_TransformType;
                requestFilterIsNull          = false;
            }
            // determine if request.Filter should be set to null
            if (requestFilterIsNull)
            {
                request.Filter = null;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = cmdletContext.MaxResult.Value;
            }

            // populate Sort
            var requestSortIsNull = true;

            request.Sort = new Amazon.Glue.Model.TransformSortCriteria();
            Amazon.Glue.TransformSortColumnType requestSort_sort_Column = null;
            if (cmdletContext.Sort_Column != null)
            {
                requestSort_sort_Column = cmdletContext.Sort_Column;
            }
            if (requestSort_sort_Column != null)
            {
                request.Sort.Column = requestSort_sort_Column;
                requestSortIsNull   = false;
            }
            Amazon.Glue.SortDirectionType requestSort_sort_SortDirection = null;
            if (cmdletContext.Sort_SortDirection != null)
            {
                requestSort_sort_SortDirection = cmdletContext.Sort_SortDirection;
            }
            if (requestSort_sort_SortDirection != null)
            {
                request.Sort.SortDirection = requestSort_sort_SortDirection;
                requestSortIsNull          = false;
            }
            // determine if request.Sort should be set to null
            if (requestSortIsNull)
            {
                request.Sort = null;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            // Initialize loop variant and commence piping
            var _nextToken             = cmdletContext.NextToken;
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            do
            {
                request.NextToken = _nextToken;

                CmdletOutput output;

                try
                {
                    var response = CallAWSServiceOperation(client, request);

                    object pipelineOutput = null;
                    if (!useParameterSelect)
                    {
                        pipelineOutput = cmdletContext.Select(response, this);
                    }
                    output = new CmdletOutput
                    {
                        PipelineOutput  = pipelineOutput,
                        ServiceResponse = response
                    };

                    _nextToken = response.NextToken;
                }
                catch (Exception e)
                {
                    output = new CmdletOutput {
                        ErrorResponse = e
                    };
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken));

            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }