Ejemplo n.º 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDetectiveConfig config = new AmazonDetectiveConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonDetectiveClient client = new AmazonDetectiveClient(creds, config);

            ListGraphsResponse resp = new ListGraphsResponse();

            do
            {
                ListGraphsRequest req = new ListGraphsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListGraphs(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.GraphList)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Returns the list of behavior graphs that the calling account is a master of. This
        /// operation can only be called by a master account.
        ///
        ///
        /// <para>
        /// Because an account can currently only be the master of one behavior graph within a
        /// Region, the results always contain a single graph.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListGraphs service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the ListGraphs service method, as returned by Detective.</returns>
        /// <exception cref="Amazon.Detective.Model.InternalServerException">
        /// The request was valid but failed because of a problem with the service.
        /// </exception>
        /// <exception cref="Amazon.Detective.Model.ValidationException">
        /// The request parameters are invalid.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/detective-2018-10-26/ListGraphs">REST API Reference for ListGraphs Operation</seealso>
        public virtual Task <ListGraphsResponse> ListGraphsAsync(ListGraphsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListGraphsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListGraphsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListGraphsResponse>(request, options, cancellationToken));
        }
        internal virtual ListGraphsResponse ListGraphs(ListGraphsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListGraphsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListGraphsResponseUnmarshaller.Instance;

            return(Invoke <ListGraphsResponse>(request, options));
        }