Пример #1
0
        /// <summary>Snippet for GetContextAsync</summary>
        public async Task GetContextAsync()
        {
            // Snippet: GetContextAsync(string, CallSettings)
            // Additional: GetContextAsync(string, CancellationToken)
            // Create client
            ContextsClient contextsClient = await ContextsClient.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/agent/sessions/[SESSION]/contexts/[CONTEXT]";
            // Make the request
            Context response = await contextsClient.GetContextAsync(name);

            // End snippet
        }
Пример #2
0
        /// <summary>Snippet for GetContextAsync</summary>
        public async Task GetContextResourceNamesAsync()
        {
            // Snippet: GetContextAsync(ContextName, CallSettings)
            // Additional: GetContextAsync(ContextName, CancellationToken)
            // Create client
            ContextsClient contextsClient = await ContextsClient.CreateAsync();

            // Initialize request argument(s)
            ContextName name = ContextName.FromProjectSessionContext("[PROJECT]", "[SESSION]", "[CONTEXT]");
            // Make the request
            Context response = await contextsClient.GetContextAsync(name);

            // End snippet
        }
Пример #3
0
        /// <summary>Snippet for GetContextAsync</summary>
        public async Task GetContextAsync_RequestObject()
        {
            // Snippet: GetContextAsync(GetContextRequest,CallSettings)
            // Additional: GetContextAsync(GetContextRequest,CancellationToken)
            // Create client
            ContextsClient contextsClient = await ContextsClient.CreateAsync();

            // Initialize request argument(s)
            GetContextRequest request = new GetContextRequest
            {
                ContextName = new ContextName("[PROJECT]", "[SESSION]", "[CONTEXT]"),
            };
            // Make the request
            Context response = await contextsClient.GetContextAsync(request);

            // End snippet
        }