/// <summary>Snippet for UpdateFieldAsync</summary> public async Task UpdateFieldAsync() { // Snippet: UpdateFieldAsync(apis::Field,CallSettings) // Additional: UpdateFieldAsync(apis::Field,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) apis::Field field = new apis::Field(); // Make the request Operation response = await firestoreAdminClient.UpdateFieldAsync(field); // End snippet }
/// <summary>Snippet for ExportDocumentsAsync</summary> public async Task ExportDocumentsAsync() { // Snippet: ExportDocumentsAsync(DatabaseName,CallSettings) // Additional: ExportDocumentsAsync(DatabaseName,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) DatabaseName name = new DatabaseName("[PROJECT]", "[DATABASE]"); // Make the request Operation response = await firestoreAdminClient.ExportDocumentsAsync(name); // End snippet }
/// <summary>Snippet for GetFieldAsync</summary> public async Task GetFieldAsync() { // Snippet: GetFieldAsync(FieldName,CallSettings) // Additional: GetFieldAsync(FieldName,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) FieldName name = new FieldName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]"); // Make the request apis::Field response = await firestoreAdminClient.GetFieldAsync(name); // End snippet }
public async Task DeleteIndexAsync() { // Snippet: DeleteIndexAsync(string,CallSettings) // Additional: DeleteIndexAsync(string,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) string formattedName = new IndexName("[PROJECT]", "[DATABASE]", "[INDEX]").ToString(); // Make the request await firestoreAdminClient.DeleteIndexAsync(formattedName); // End snippet }
/// <summary>Snippet for DeleteIndexAsync</summary> public async Task DeleteIndexAsync() { // Snippet: DeleteIndexAsync(IndexName,CallSettings) // Additional: DeleteIndexAsync(IndexName,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) IndexName name = new IndexName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]"); // Make the request await firestoreAdminClient.DeleteIndexAsync(name); // End snippet }
/// <summary>Snippet for CreateIndexAsync</summary> public async Task CreateIndexAsync() { // Snippet: CreateIndexAsync(ParentName,Index,CallSettings) // Additional: CreateIndexAsync(ParentName,Index,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) ParentName parent = new ParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"); Index index = new Index(); // Make the request Operation response = await firestoreAdminClient.CreateIndexAsync(parent, index); // End snippet }
public async Task CreateIndexAsync() { // Snippet: CreateIndexAsync(string,Index,CallSettings) // Additional: CreateIndexAsync(string,Index,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) string formattedParent = new DatabaseName("[PROJECT]", "[DATABASE]").ToString(); Index index = new Index(); // Make the request Operation response = await firestoreAdminClient.CreateIndexAsync(formattedParent, index); // End snippet }
public async Task DeleteIndexAsync_RequestObject() { // Snippet: DeleteIndexAsync(DeleteIndexRequest,CallSettings) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) DeleteIndexRequest request = new DeleteIndexRequest { Name = new IndexName("[PROJECT]", "[DATABASE]", "[INDEX]").ToString(), }; // Make the request await firestoreAdminClient.DeleteIndexAsync(request); // End snippet }
/// <summary>Snippet for ListFieldsAsync</summary> public async Task ListFieldsAsync_RequestObject() { // Snippet: ListFieldsAsync(ListFieldsRequest,CallSettings) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) ListFieldsRequest request = new ListFieldsRequest { ParentAsParentName = new ParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"), }; // Make the request PagedAsyncEnumerable <ListFieldsResponse, apis::Field> response = firestoreAdminClient.ListFieldsAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((apis::Field 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((ListFieldsResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (apis::Field 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 <apis::Field> 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 (apis::Field item in singlePage) { Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
/// <summary>Snippet for ImportDocumentsAsync</summary> public async Task ImportDocumentsAsync_RequestObject() { // Snippet: ImportDocumentsAsync(ImportDocumentsRequest,CallSettings) // Additional: ImportDocumentsAsync(ImportDocumentsRequest,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) ImportDocumentsRequest request = new ImportDocumentsRequest { DatabaseName = new DatabaseName("[PROJECT]", "[DATABASE]"), }; // Make the request Operation response = await firestoreAdminClient.ImportDocumentsAsync(request); // End snippet }
/// <summary>Snippet for GetIndexAsync</summary> public async Task GetIndexAsync_RequestObject() { // Snippet: GetIndexAsync(GetIndexRequest,CallSettings) // Additional: GetIndexAsync(GetIndexRequest,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) GetIndexRequest request = new GetIndexRequest { IndexName = new IndexName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]"), }; // Make the request Index response = await firestoreAdminClient.GetIndexAsync(request); // End snippet }
public async Task CreateIndexAsync_RequestObject() { // Snippet: CreateIndexAsync(CreateIndexRequest,CallSettings) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) CreateIndexRequest request = new CreateIndexRequest { Parent = new DatabaseName("[PROJECT]", "[DATABASE]").ToString(), Index = new Index(), }; // Make the request Operation response = await firestoreAdminClient.CreateIndexAsync(request); // End snippet }
/// <summary>Snippet for CreateIndexAsync</summary> public async Task CreateIndexAsync_RequestObject() { // Snippet: CreateIndexAsync(CreateIndexRequest,CallSettings) // Additional: CreateIndexAsync(CreateIndexRequest,CancellationToken) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) CreateIndexRequest request = new CreateIndexRequest { ParentAsParentName = new ParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"), Index = new Index(), }; // Make the request Operation response = await firestoreAdminClient.CreateIndexAsync(request); // End snippet }
public async Task ListIndexesAsync() { // Snippet: ListIndexesAsync(string,string,int?,CallSettings) // Create client FirestoreAdminClient firestoreAdminClient = await FirestoreAdminClient.CreateAsync(); // Initialize request argument(s) string formattedParent = new DatabaseName("[PROJECT]", "[DATABASE]").ToString(); // Make the request PagedAsyncEnumerable <ListIndexesResponse, Index> response = firestoreAdminClient.ListIndexesAsync(formattedParent); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Index 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((ListIndexesResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Index 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 <Index> 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 (Index item in singlePage) { Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }