Пример #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonSimpleSystemsManagementConfig config = new AmazonSimpleSystemsManagementConfig();

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

            ListDocumentsResponse resp = new ListDocumentsResponse();

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

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

                foreach (var obj in resp.DocumentIdentifiers)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        internal ListDocumentsResponse ListDocuments(ListDocumentsRequest request)
        {
            var marshaller   = new ListDocumentsRequestMarshaller();
            var unmarshaller = ListDocumentsResponseUnmarshaller.Instance;

            return(Invoke <ListDocumentsRequest, ListDocumentsResponse>(request, marshaller, unmarshaller));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListDocuments operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListDocuments operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <ListDocumentsResponse> ListDocumentsAsync(ListDocumentsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListDocumentsRequestMarshaller();
            var unmarshaller = ListDocumentsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListDocumentsRequest, ListDocumentsResponse>(request, marshaller,
                                                                             unmarshaller, cancellationToken));
        }
Пример #4
0
        /// <summary>Snippet for ListDocuments</summary>
        public async Task ListDocumentsRequestObjectAsync()
        {
            // Snippet: ListDocumentsAsync(ListDocumentsRequest, CallSettings)
            // Create client
            FirestoreClient firestoreClient = await FirestoreClient.CreateAsync();

            // Initialize request argument(s)
            ListDocumentsRequest request = new ListDocumentsRequest
            {
                Parent       = "",
                CollectionId = "",
                OrderBy      = "",
                Mask         = new DocumentMask(),
                Transaction  = ByteString.Empty,
                ReadTime     = new Timestamp(),
                ShowMissing  = false,
            };
            // Make the request
            PagedAsyncEnumerable <ListDocumentsResponse, Document> response = firestoreClient.ListDocumentsAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Document item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListDocumentsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Document item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int             pageSize   = 10;
            Page <Document> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Document item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
Пример #5
0
        /// <summary>
        /// Lists the documents in this collection. The results include documents which don't exist in their own right, but which have
        /// nested documents which do exist.
        /// </summary>
        /// <returns>A lazily-iterated sequence of document references within this collection.</returns>
        public IAsyncEnumerable <DocumentReference> ListDocumentsAsync()
        {
            var request = new ListDocumentsRequest
            {
                CollectionId = Id,
                Parent       = ParentPath,
                ShowMissing  = true,
                Mask         = new DocumentMask()
            };

            return(Database.Client.ListDocumentsAsync(request).Select(doc => Database.GetDocumentReferenceFromResourceName(doc.Name)));
        }
Пример #6
0
        public static void document(Firestore.FirestoreClient client, ref Dictionary <string, long> metrics)
        {
            ListDocumentsRequest list_document_request = new ListDocumentsRequest();

            list_document_request.Parent = _PARENT_RESOURCE;

            stopwatch.Start();
            client.ListDocuments(list_document_request);
            stopwatch.Stop();


            long lantency = stopwatch.ElapsedMilliseconds;

            metrics.Add("list_documents_latency_ms", lantency);
        }
Пример #7
0
        public void ListDocuments()
        {
            var listDocumentsRequest = new ListDocumentsRequest();

            listDocumentsRequest.Parent = Parent;
            var listDocumentsResponse = FsClient.ListDocuments(listDocumentsRequest);
            var documents             = listDocumentsResponse.Documents;
            int i = 0;

            foreach (var document in documents)
            {
                i++;
                FirestoreTestUtils.ColoredConsoleWrite(ConsoleColor.White, "\nDocument " + i + ": " + document.Name + "");
            }
        }
        /// <summary>Snippet for ListDocumentsAsync</summary>
        public async Task ListDocumentsAsync_RequestObject()
        {
            // Snippet: ListDocumentsAsync(ListDocumentsRequest,CallSettings)
            // Create client
            FirestoreClient firestoreClient = await FirestoreClient.CreateAsync();

            // Initialize request argument(s)
            ListDocumentsRequest request = new ListDocumentsRequest
            {
                Parent       = new AnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]").ToString(),
                CollectionId = "",
            };
            // Make the request
            PagedAsyncEnumerable <ListDocumentsResponse, Document> response =
                firestoreClient.ListDocumentsAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Document item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListDocumentsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Document item in page)
                {
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int             pageSize   = 10;
            Page <Document> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Document item in singlePage)
            {
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
        static bool ListDocuments(string url, Credentials c)
        {
            Console.WriteLine("Listing documents...");

            ArticulateOnline ao = new ArticulateOnline {
                Url = url
            };
            ListDocumentsRequest request = new ListDocumentsRequest {
                Credentials = c
            };
            ListDocumentsResponse response = ao.ListDocuments(request);

            if (response.Success)
            {
                foreach (DocumentSummary ds in response.Documents)
                {
                    Console.WriteLine("{0} {1} {2}", ds.DocumentID, ds.Name, ds.Description);
                }
            }
            return(response.Success);
        }
Пример #10
0
 /// <inheritdoc />
 public void ListDocuments(ListDocumentsRequest request)
 {
     throw new System.NotImplementedException();
 }
Пример #11
0
 partial void Modify_ListDocumentsRequest(ref ListDocumentsRequest request, ref CallSettings settings) =>
 ApplyResourcePrefixHeader(ref settings, request.Parent);