/// <summary>Snippet for RemovePublicKeyAsync</summary> public async Task RemovePublicKeyRequestObjectAsync() { // Snippet: RemovePublicKeyAsync(RemovePublicKeyRequest, CallSettings) // Additional: RemovePublicKeyAsync(RemovePublicKeyRequest, CancellationToken) // Create client CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync(); // Initialize request argument(s) RemovePublicKeyRequest request = new RemovePublicKeyRequest { Environment = "", Key = "", }; // Make the request Operation <RemovePublicKeyResponse, RemovePublicKeyMetadata> response = await cloudShellServiceClient.RemovePublicKeyAsync(request); // Poll until the returned long-running operation is complete Operation <RemovePublicKeyResponse, RemovePublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result RemovePublicKeyResponse result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <RemovePublicKeyResponse, RemovePublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceRemovePublicKeyAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result RemovePublicKeyResponse retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for AddPublicKey</summary> public void AddPublicKeyRequestObject() { // Snippet: AddPublicKey(AddPublicKeyRequest, CallSettings) // Create client CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create(); // Initialize request argument(s) AddPublicKeyRequest request = new AddPublicKeyRequest { Environment = "", Key = "", }; // Make the request Operation <AddPublicKeyResponse, AddPublicKeyMetadata> response = cloudShellServiceClient.AddPublicKey(request); // Poll until the returned long-running operation is complete Operation <AddPublicKeyResponse, AddPublicKeyMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result AddPublicKeyResponse result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <AddPublicKeyResponse, AddPublicKeyMetadata> retrievedResponse = cloudShellServiceClient.PollOnceAddPublicKey(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result AddPublicKeyResponse retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for GetEnvironment</summary> public void GetEnvironmentResourceNames() { // Snippet: GetEnvironment(EnvironmentName, CallSettings) // Create client CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create(); // Initialize request argument(s) EnvironmentName name = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"); // Make the request Environment response = cloudShellServiceClient.GetEnvironment(name); // End snippet }
/// <summary>Snippet for GetEnvironment</summary> public void GetEnvironment() { // Snippet: GetEnvironment(string, CallSettings) // Create client CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create(); // Initialize request argument(s) string name = "users/[USER]/environments/[ENVIRONMENT]"; // Make the request Environment response = cloudShellServiceClient.GetEnvironment(name); // End snippet }
/// <summary>Snippet for GetEnvironmentAsync</summary> public async Task GetEnvironmentAsync() { // Snippet: GetEnvironmentAsync(string, CallSettings) // Additional: GetEnvironmentAsync(string, CancellationToken) // Create client CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync(); // Initialize request argument(s) string name = "users/[USER]/environments/[ENVIRONMENT]"; // Make the request Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name); // End snippet }
/// <summary>Snippet for GetEnvironment</summary> public void GetEnvironmentRequestObject() { // Snippet: GetEnvironment(GetEnvironmentRequest, CallSettings) // Create client CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create(); // Initialize request argument(s) GetEnvironmentRequest request = new GetEnvironmentRequest { EnvironmentName = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"), }; // Make the request Environment response = cloudShellServiceClient.GetEnvironment(request); // End snippet }
/// <summary>Snippet for GetEnvironmentAsync</summary> public async Task GetEnvironmentResourceNamesAsync() { // Snippet: GetEnvironmentAsync(EnvironmentName, CallSettings) // Additional: GetEnvironmentAsync(EnvironmentName, CancellationToken) // Create client CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync(); // Initialize request argument(s) EnvironmentName name = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"); // Make the request Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name); // End snippet }
/// <summary>Snippet for AuthorizeEnvironmentAsync</summary> public async Task AuthorizeEnvironmentRequestObjectAsync() { // Snippet: AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest, CallSettings) // Additional: AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest, CancellationToken) // Create client CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync(); // Initialize request argument(s) AuthorizeEnvironmentRequest request = new AuthorizeEnvironmentRequest { Name = "", AccessToken = "", ExpireTime = new Timestamp(), IdToken = "", }; // Make the request Operation <AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> response = await cloudShellServiceClient.AuthorizeEnvironmentAsync(request); // Poll until the returned long-running operation is complete Operation <AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result AuthorizeEnvironmentResponse result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAuthorizeEnvironmentAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result AuthorizeEnvironmentResponse retrievedResult = retrievedResponse.Result; } // End snippet }