Exemple #1
0
 /// <summary>
 /// Paginator for ListClassificationJobs operation
 ///</summary>
 public IListClassificationJobsPaginator ListClassificationJobs(ListClassificationJobsRequest request)
 {
     return(new ListClassificationJobsPaginator(this.client, request));
 }
Exemple #2
0
 private Amazon.Macie2.Model.ListClassificationJobsResponse CallAWSServiceOperation(IAmazonMacie2 client, Amazon.Macie2.Model.ListClassificationJobsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Macie 2", "ListClassificationJobs");
     try
     {
         #if DESKTOP
         return(client.ListClassificationJobs(request));
         #elif CORECLR
         return(client.ListClassificationJobsAsync(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;
     }
 }
Exemple #3
0
 internal ListClassificationJobsPaginator(IAmazonMacie2 client, ListClassificationJobsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
Exemple #4
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Macie2.Model.ListClassificationJobsRequest();


            // populate FilterCriteria
            var requestFilterCriteriaIsNull = true;

            request.FilterCriteria = new Amazon.Macie2.Model.ListJobsFilterCriteria();
            List <Amazon.Macie2.Model.ListJobsFilterTerm> requestFilterCriteria_filterCriteria_Exclude = null;

            if (cmdletContext.FilterCriteria_Exclude != null)
            {
                requestFilterCriteria_filterCriteria_Exclude = cmdletContext.FilterCriteria_Exclude;
            }
            if (requestFilterCriteria_filterCriteria_Exclude != null)
            {
                request.FilterCriteria.Excludes = requestFilterCriteria_filterCriteria_Exclude;
                requestFilterCriteriaIsNull     = false;
            }
            List <Amazon.Macie2.Model.ListJobsFilterTerm> requestFilterCriteria_filterCriteria_Include = null;

            if (cmdletContext.FilterCriteria_Include != null)
            {
                requestFilterCriteria_filterCriteria_Include = cmdletContext.FilterCriteria_Include;
            }
            if (requestFilterCriteria_filterCriteria_Include != null)
            {
                request.FilterCriteria.Includes = requestFilterCriteria_filterCriteria_Include;
                requestFilterCriteriaIsNull     = false;
            }
            // determine if request.FilterCriteria should be set to null
            if (requestFilterCriteriaIsNull)
            {
                request.FilterCriteria = null;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = cmdletContext.MaxResult.Value;
            }
            if (cmdletContext.NextToken != null)
            {
                request.NextToken = cmdletContext.NextToken;
            }

            // populate SortCriteria
            var requestSortCriteriaIsNull = true;

            request.SortCriteria = new Amazon.Macie2.Model.ListJobsSortCriteria();
            Amazon.Macie2.ListJobsSortAttributeName requestSortCriteria_sortCriteria_AttributeName = null;
            if (cmdletContext.SortCriteria_AttributeName != null)
            {
                requestSortCriteria_sortCriteria_AttributeName = cmdletContext.SortCriteria_AttributeName;
            }
            if (requestSortCriteria_sortCriteria_AttributeName != null)
            {
                request.SortCriteria.AttributeName = requestSortCriteria_sortCriteria_AttributeName;
                requestSortCriteriaIsNull          = false;
            }
            Amazon.Macie2.OrderBy requestSortCriteria_sortCriteria_OrderBy = null;
            if (cmdletContext.SortCriteria_OrderBy != null)
            {
                requestSortCriteria_sortCriteria_OrderBy = cmdletContext.SortCriteria_OrderBy;
            }
            if (requestSortCriteria_sortCriteria_OrderBy != null)
            {
                request.SortCriteria.OrderBy = requestSortCriteria_sortCriteria_OrderBy;
                requestSortCriteriaIsNull    = false;
            }
            // determine if request.SortCriteria should be set to null
            if (requestSortCriteriaIsNull)
            {
                request.SortCriteria = 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);
        }