/// <summary>Snippet for DeleteSessionEntityTypeAsync</summary>
        public async Task DeleteSessionEntityTypeAsync()
        {
            // Snippet: DeleteSessionEntityTypeAsync(SessionEntityTypeName,CallSettings)
            // Additional: DeleteSessionEntityTypeAsync(SessionEntityTypeName,CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            SessionEntityTypeName name = new SessionEntityTypeName("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
            // Make the request
            await sessionEntityTypesClient.DeleteSessionEntityTypeAsync(name);

            // End snippet
        }
        /// <summary>Snippet for UpdateSessionEntityTypeAsync</summary>
        public async Task UpdateSessionEntityTypeAsync()
        {
            // Snippet: UpdateSessionEntityTypeAsync(SessionEntityType,CallSettings)
            // Additional: UpdateSessionEntityTypeAsync(SessionEntityType,CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            SessionEntityType sessionEntityType = new SessionEntityType();
            // Make the request
            SessionEntityType response = await sessionEntityTypesClient.UpdateSessionEntityTypeAsync(sessionEntityType);

            // End snippet
        }
Exemplo n.º 3
0
        /// <summary>Snippet for DeleteSessionEntityTypeAsync</summary>
        public async Task DeleteSessionEntityTypeAsync()
        {
            // Snippet: DeleteSessionEntityTypeAsync(string, CallSettings)
            // Additional: DeleteSessionEntityTypeAsync(string, CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/sessions/[SESSION]/entityTypes/[ENTITY_TYPE]";
            // Make the request
            await sessionEntityTypesClient.DeleteSessionEntityTypeAsync(name);

            // End snippet
        }
Exemplo n.º 4
0
        /// <summary>Snippet for GetSessionEntityTypeAsync</summary>
        public async Task GetSessionEntityTypeResourceNamesAsync()
        {
            // Snippet: GetSessionEntityTypeAsync(SessionEntityTypeName, CallSettings)
            // Additional: GetSessionEntityTypeAsync(SessionEntityTypeName, CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            SessionEntityTypeName name = SessionEntityTypeName.FromProjectLocationAgentSessionEntityType("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
            // Make the request
            SessionEntityType response = await sessionEntityTypesClient.GetSessionEntityTypeAsync(name);

            // End snippet
        }
Exemplo n.º 5
0
        /// <summary>Snippet for DeleteSessionEntityTypeAsync</summary>
        public async Task DeleteSessionEntityTypeResourceNamesAsync()
        {
            // Snippet: DeleteSessionEntityTypeAsync(ContextName, CallSettings)
            // Additional: DeleteSessionEntityTypeAsync(ContextName, CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            ContextName name = ContextName.FromProjectSessionContext("[PROJECT]", "[SESSION]", "[CONTEXT]");
            // Make the request
            await sessionEntityTypesClient.DeleteSessionEntityTypeAsync(name);

            // End snippet
        }
        /// <summary>Snippet for CreateSessionEntityTypeAsync</summary>
        public async Task CreateSessionEntityTypeAsync()
        {
            // Snippet: CreateSessionEntityTypeAsync(SessionName,SessionEntityType,CallSettings)
            // Additional: CreateSessionEntityTypeAsync(SessionName,SessionEntityType,CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            SessionName       parent            = new SessionName("[PROJECT]", "[SESSION]");
            SessionEntityType sessionEntityType = new SessionEntityType();
            // Make the request
            SessionEntityType response = await sessionEntityTypesClient.CreateSessionEntityTypeAsync(parent, sessionEntityType);

            // End snippet
        }
Exemplo n.º 7
0
        /// <summary>Snippet for CreateSessionEntityTypeAsync</summary>
        public async Task CreateSessionEntityTypeAsync()
        {
            // Snippet: CreateSessionEntityTypeAsync(string, SessionEntityType, CallSettings)
            // Additional: CreateSessionEntityTypeAsync(string, SessionEntityType, CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            string            parent            = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/sessions/[SESSION]";
            SessionEntityType sessionEntityType = new SessionEntityType();
            // Make the request
            SessionEntityType response = await sessionEntityTypesClient.CreateSessionEntityTypeAsync(parent, sessionEntityType);

            // End snippet
        }
Exemplo n.º 8
0
        /// <summary>Snippet for ListSessionEntityTypesAsync</summary>
        public async Task ListSessionEntityTypesRequestObjectAsync()
        {
            // Snippet: ListSessionEntityTypesAsync(ListSessionEntityTypesRequest, CallSettings)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            ListSessionEntityTypesRequest request = new ListSessionEntityTypesRequest
            {
                ParentAsSessionName = SessionName.FromProjectLocationAgentSession("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"),
            };
            // Make the request
            PagedAsyncEnumerable <ListSessionEntityTypesResponse, SessionEntityType> response = sessionEntityTypesClient.ListSessionEntityTypesAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((SessionEntityType 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((ListSessionEntityTypesResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (SessionEntityType 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 <SessionEntityType> 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 (SessionEntityType 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
        }
        /// <summary>Snippet for UpdateSessionEntityTypeAsync</summary>
        public async Task UpdateSessionEntityTypeAsync_RequestObject()
        {
            // Snippet: UpdateSessionEntityTypeAsync(UpdateSessionEntityTypeRequest,CallSettings)
            // Additional: UpdateSessionEntityTypeAsync(UpdateSessionEntityTypeRequest,CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            UpdateSessionEntityTypeRequest request = new UpdateSessionEntityTypeRequest
            {
                SessionEntityType = new SessionEntityType(),
            };
            // Make the request
            SessionEntityType response = await sessionEntityTypesClient.UpdateSessionEntityTypeAsync(request);

            // End snippet
        }
        /// <summary>Snippet for GetSessionEntityTypeAsync</summary>
        public async Task GetSessionEntityTypeAsync_RequestObject()
        {
            // Snippet: GetSessionEntityTypeAsync(GetSessionEntityTypeRequest,CallSettings)
            // Additional: GetSessionEntityTypeAsync(GetSessionEntityTypeRequest,CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            GetSessionEntityTypeRequest request = new GetSessionEntityTypeRequest
            {
                SessionEntityTypeName = new SessionEntityTypeName("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]"),
            };
            // Make the request
            SessionEntityType response = await sessionEntityTypesClient.GetSessionEntityTypeAsync(request);

            // End snippet
        }
Exemplo n.º 11
0
        /// <summary>Snippet for DeleteSessionEntityTypeAsync</summary>
        public async Task DeleteSessionEntityTypeRequestObjectAsync()
        {
            // Snippet: DeleteSessionEntityTypeAsync(DeleteSessionEntityTypeRequest, CallSettings)
            // Additional: DeleteSessionEntityTypeAsync(DeleteSessionEntityTypeRequest, CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            DeleteSessionEntityTypeRequest request = new DeleteSessionEntityTypeRequest
            {
                SessionEntityTypeName = SessionEntityTypeName.FromProjectLocationAgentSessionEntityType("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"),
            };
            // Make the request
            await sessionEntityTypesClient.DeleteSessionEntityTypeAsync(request);

            // End snippet
        }
        /// <summary>Snippet for CreateSessionEntityTypeAsync</summary>
        public async Task CreateSessionEntityTypeAsync_RequestObject()
        {
            // Snippet: CreateSessionEntityTypeAsync(CreateSessionEntityTypeRequest,CallSettings)
            // Additional: CreateSessionEntityTypeAsync(CreateSessionEntityTypeRequest,CancellationToken)
            // Create client
            SessionEntityTypesClient sessionEntityTypesClient = await SessionEntityTypesClient.CreateAsync();

            // Initialize request argument(s)
            CreateSessionEntityTypeRequest request = new CreateSessionEntityTypeRequest
            {
                ParentAsSessionName = new SessionName("[PROJECT]", "[SESSION]"),
                SessionEntityType   = new SessionEntityType(),
            };
            // Make the request
            SessionEntityType response = await sessionEntityTypesClient.CreateSessionEntityTypeAsync(request);

            // End snippet
        }