/// <summary>Snippet for CreateDocumentAsync</summary>
        public async Task CreateDocumentAsync_RequestObject()
        {
            // Snippet: CreateDocumentAsync(CreateDocumentRequest,CallSettings)
            // Create client
            FirestoreClient firestoreClient = await FirestoreClient.CreateAsync();

            // Initialize request argument(s)
            CreateDocumentRequest request = new CreateDocumentRequest
            {
                Parent       = new AnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]").ToString(),
                CollectionId = "",
                DocumentId   = "",
                Document     = new Document(),
            };
            // Make the request
            Document response = await firestoreClient.CreateDocumentAsync(request);

            // End snippet
        }
Пример #2
0
        /// <summary>Snippet for CreateDocumentAsync</summary>
        public async Task CreateDocumentRequestObjectAsync()
        {
            // Snippet: CreateDocumentAsync(CreateDocumentRequest, CallSettings)
            // Additional: CreateDocumentAsync(CreateDocumentRequest, CancellationToken)
            // Create client
            FirestoreClient firestoreClient = await FirestoreClient.CreateAsync();

            // Initialize request argument(s)
            CreateDocumentRequest request = new CreateDocumentRequest
            {
                Parent       = "",
                CollectionId = "",
                DocumentId   = "",
                Document     = new Document(),
                Mask         = new DocumentMask(),
            };
            // Make the request
            Document response = await firestoreClient.CreateDocumentAsync(request);

            // End snippet
        }