Exemple #1
0
 /// <summary>
 /// Paginator for SearchResources operation
 ///</summary>
 public ISearchResourcesPaginator SearchResources(SearchResourcesRequest request)
 {
     return(new SearchResourcesPaginator(this.client, request));
 }
Exemple #2
0
 private Amazon.Macie2.Model.SearchResourcesResponse CallAWSServiceOperation(IAmazonMacie2 client, Amazon.Macie2.Model.SearchResourcesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Macie 2", "SearchResources");
     try
     {
         #if DESKTOP
         return(client.SearchResources(request));
         #elif CORECLR
         return(client.SearchResourcesAsync(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 SearchResourcesPaginator(IAmazonMacie2 client, SearchResourcesRequest 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.SearchResourcesRequest();


            // populate BucketCriteria
            var requestBucketCriteriaIsNull = true;

            request.BucketCriteria = new Amazon.Macie2.Model.SearchResourcesBucketCriteria();
            Amazon.Macie2.Model.SearchResourcesCriteriaBlock requestBucketCriteria_bucketCriteria_Excludes = null;

            // populate Excludes
            var requestBucketCriteria_bucketCriteria_ExcludesIsNull = true;

            requestBucketCriteria_bucketCriteria_Excludes = new Amazon.Macie2.Model.SearchResourcesCriteriaBlock();
            List <Amazon.Macie2.Model.SearchResourcesCriteria> requestBucketCriteria_bucketCriteria_Excludes_excludes_And = null;

            if (cmdletContext.Excludes_And != null)
            {
                requestBucketCriteria_bucketCriteria_Excludes_excludes_And = cmdletContext.Excludes_And;
            }
            if (requestBucketCriteria_bucketCriteria_Excludes_excludes_And != null)
            {
                requestBucketCriteria_bucketCriteria_Excludes.And   = requestBucketCriteria_bucketCriteria_Excludes_excludes_And;
                requestBucketCriteria_bucketCriteria_ExcludesIsNull = false;
            }
            // determine if requestBucketCriteria_bucketCriteria_Excludes should be set to null
            if (requestBucketCriteria_bucketCriteria_ExcludesIsNull)
            {
                requestBucketCriteria_bucketCriteria_Excludes = null;
            }
            if (requestBucketCriteria_bucketCriteria_Excludes != null)
            {
                request.BucketCriteria.Excludes = requestBucketCriteria_bucketCriteria_Excludes;
                requestBucketCriteriaIsNull     = false;
            }
            Amazon.Macie2.Model.SearchResourcesCriteriaBlock requestBucketCriteria_bucketCriteria_Includes = null;

            // populate Includes
            var requestBucketCriteria_bucketCriteria_IncludesIsNull = true;

            requestBucketCriteria_bucketCriteria_Includes = new Amazon.Macie2.Model.SearchResourcesCriteriaBlock();
            List <Amazon.Macie2.Model.SearchResourcesCriteria> requestBucketCriteria_bucketCriteria_Includes_includes_And = null;

            if (cmdletContext.Includes_And != null)
            {
                requestBucketCriteria_bucketCriteria_Includes_includes_And = cmdletContext.Includes_And;
            }
            if (requestBucketCriteria_bucketCriteria_Includes_includes_And != null)
            {
                requestBucketCriteria_bucketCriteria_Includes.And   = requestBucketCriteria_bucketCriteria_Includes_includes_And;
                requestBucketCriteria_bucketCriteria_IncludesIsNull = false;
            }
            // determine if requestBucketCriteria_bucketCriteria_Includes should be set to null
            if (requestBucketCriteria_bucketCriteria_IncludesIsNull)
            {
                requestBucketCriteria_bucketCriteria_Includes = null;
            }
            if (requestBucketCriteria_bucketCriteria_Includes != null)
            {
                request.BucketCriteria.Includes = requestBucketCriteria_bucketCriteria_Includes;
                requestBucketCriteriaIsNull     = false;
            }
            // determine if request.BucketCriteria should be set to null
            if (requestBucketCriteriaIsNull)
            {
                request.BucketCriteria = 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.SearchResourcesSortCriteria();
            Amazon.Macie2.SearchResourcesSortAttributeName 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);
        }