public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Macie2.Model.DescribeBucketsRequest();

            if (cmdletContext.Criterion != null)
            {
                request.Criteria = cmdletContext.Criterion;
            }
            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.BucketSortCriteria();
            System.String 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);
        }
Пример #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Macie2.Model.GetUsageStatisticsRequest();

            if (cmdletContext.FilterBy != null)
            {
                request.FilterBy = cmdletContext.FilterBy;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = cmdletContext.MaxResult.Value;
            }
            if (cmdletContext.NextToken != null)
            {
                request.NextToken = cmdletContext.NextToken;
            }

            // populate SortBy
            var requestSortByIsNull = true;

            request.SortBy = new Amazon.Macie2.Model.UsageStatisticsSortBy();
            Amazon.Macie2.UsageStatisticsSortKey requestSortBy_sortBy_Key = null;
            if (cmdletContext.SortBy_Key != null)
            {
                requestSortBy_sortBy_Key = cmdletContext.SortBy_Key;
            }
            if (requestSortBy_sortBy_Key != null)
            {
                request.SortBy.Key  = requestSortBy_sortBy_Key;
                requestSortByIsNull = false;
            }
            Amazon.Macie2.OrderBy requestSortBy_sortBy_OrderBy = null;
            if (cmdletContext.SortBy_OrderBy != null)
            {
                requestSortBy_sortBy_OrderBy = cmdletContext.SortBy_OrderBy;
            }
            if (requestSortBy_sortBy_OrderBy != null)
            {
                request.SortBy.OrderBy = requestSortBy_sortBy_OrderBy;
                requestSortByIsNull    = false;
            }
            // determine if request.SortBy should be set to null
            if (requestSortByIsNull)
            {
                request.SortBy = null;
            }
            if (cmdletContext.TimeRange != null)
            {
                request.TimeRange = cmdletContext.TimeRange;
            }

            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);
        }
Пример #3
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Macie2.Model.GetFindingStatisticsRequest();


            // populate FindingCriteria
            var requestFindingCriteriaIsNull = true;

            request.FindingCriteria = new Amazon.Macie2.Model.FindingCriteria();
            Dictionary <System.String, Amazon.Macie2.Model.CriterionAdditionalProperties> requestFindingCriteria_findingCriteria_Criterion = null;

            if (cmdletContext.FindingCriteria_Criterion != null)
            {
                requestFindingCriteria_findingCriteria_Criterion = cmdletContext.FindingCriteria_Criterion;
            }
            if (requestFindingCriteria_findingCriteria_Criterion != null)
            {
                request.FindingCriteria.Criterion = requestFindingCriteria_findingCriteria_Criterion;
                requestFindingCriteriaIsNull      = false;
            }
            // determine if request.FindingCriteria should be set to null
            if (requestFindingCriteriaIsNull)
            {
                request.FindingCriteria = null;
            }
            if (cmdletContext.GroupBy != null)
            {
                request.GroupBy = cmdletContext.GroupBy;
            }
            if (cmdletContext.Size != null)
            {
                request.Size = cmdletContext.Size.Value;
            }

            // populate SortCriteria
            var requestSortCriteriaIsNull = true;

            request.SortCriteria = new Amazon.Macie2.Model.FindingStatisticsSortCriteria();
            Amazon.Macie2.FindingStatisticsSortAttributeName 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);
        }
Пример #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);
        }