/// <summary>Snippet for CreateContext</summary> public void CreateContextResourceNames() { // Snippet: CreateContext(SessionName, Context, CallSettings) // Create client ContextsClient contextsClient = ContextsClient.Create(); // Initialize request argument(s) SessionName parent = SessionName.FromProjectSession("[PROJECT]", "[SESSION]"); Context context = new Context(); // Make the request Context response = contextsClient.CreateContext(parent, context); // End snippet }
/// <summary>Snippet for CreateContext</summary> public void CreateContext() { // Snippet: CreateContext(string, Context, CallSettings) // Create client ContextsClient contextsClient = ContextsClient.Create(); // Initialize request argument(s) string parent = "projects/[PROJECT]/agent/sessions/[SESSION]"; Context context = new Context(); // Make the request Context response = contextsClient.CreateContext(parent, context); // End snippet }
/// <summary>Snippet for CreateContext</summary> public void CreateContextRequestObject() { // Snippet: CreateContext(CreateContextRequest, CallSettings) // Create client ContextsClient contextsClient = ContextsClient.Create(); // Initialize request argument(s) CreateContextRequest request = new CreateContextRequest { ParentAsSessionName = SessionName.FromProjectSession("[PROJECT]", "[SESSION]"), Context = new Context(), }; // Make the request Context response = contextsClient.CreateContext(request); // End snippet }
/// <summary>Snippet for CreateContext</summary> public void CreateContextRequestObject() { // Snippet: CreateContext(CreateContextRequest, CallSettings) // Create client ContextsClient contextsClient = ContextsClient.Create(); // Initialize request argument(s) CreateContextRequest request = new CreateContextRequest { Parent = "", Context = new Context(), }; // Make the request Context response = contextsClient.CreateContext(request); // End snippet }