Exemplo n.º 1
0
        /// <summary>Snippet for CreateKnowledgeBaseAsync</summary>
        public async Task CreateKnowledgeBaseAsync()
        {
            // Snippet: CreateKnowledgeBaseAsync(string, KnowledgeBase, CallSettings)
            // Additional: CreateKnowledgeBaseAsync(string, KnowledgeBase, CancellationToken)
            // Create client
            KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();

            // Initialize request argument(s)
            string        parent        = "projects/[PROJECT]";
            KnowledgeBase knowledgeBase = new KnowledgeBase();
            // Make the request
            KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(parent, knowledgeBase);

            // End snippet
        }
Exemplo n.º 2
0
        /// <summary>Snippet for CreateKnowledgeBaseAsync</summary>
        public async Task CreateKnowledgeBaseResourceNames2Async()
        {
            // Snippet: CreateKnowledgeBaseAsync(LocationName, KnowledgeBase, CallSettings)
            // Additional: CreateKnowledgeBaseAsync(LocationName, KnowledgeBase, CancellationToken)
            // Create client
            KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();

            // Initialize request argument(s)
            LocationName  parent        = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
            KnowledgeBase knowledgeBase = new KnowledgeBase();
            // Make the request
            KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(parent, knowledgeBase);

            // End snippet
        }
Exemplo n.º 3
0
        /// <summary>Snippet for CreateKnowledgeBaseAsync</summary>
        public async Task CreateKnowledgeBaseRequestObjectAsync()
        {
            // Snippet: CreateKnowledgeBaseAsync(CreateKnowledgeBaseRequest, CallSettings)
            // Additional: CreateKnowledgeBaseAsync(CreateKnowledgeBaseRequest, CancellationToken)
            // Create client
            KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();

            // Initialize request argument(s)
            CreateKnowledgeBaseRequest request = new CreateKnowledgeBaseRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                KnowledgeBase       = new KnowledgeBase(),
            };
            // Make the request
            KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(request);

            // End snippet
        }