/// <summary>Snippet for GetConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetConnectionAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string name = "projects/[PROJECT]/locations/[LOCATION]/connections/[CONNECTION]"; // Make the request Connection response = await connectionServiceClient.GetConnectionAsync(name); }
/// <summary>Snippet for DeleteConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task DeleteConnectionResourceNamesAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) ConnectionName name = ConnectionName.FromProjectLocationConnection("[PROJECT]", "[LOCATION]", "[CONNECTION]"); // Make the request await connectionServiceClient.DeleteConnectionAsync(name); }
/// <summary>Snippet for GetIamPolicyAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetIamPolicyResourceNamesAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); GetPolicyOptions options = new GetPolicyOptions(); // Make the request Policy response = await connectionServiceClient.GetIamPolicyAsync(resource, options); }
/// <summary>Snippet for ListConnectionsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task ListConnectionsAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]"; uint? maxResults = 0U; // Make the request ListConnectionsResponse response = await connectionServiceClient.ListConnectionsAsync(parent, maxResults); }
/// <summary>Snippet for TestIamPermissionsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task TestIamPermissionsResourceNamesAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <string> permissions = new string[] { "", }; // Make the request TestIamPermissionsResponse response = await connectionServiceClient.TestIamPermissionsAsync(resource, permissions); }
/// <summary>Snippet for UpdateConnectionCredentialAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task UpdateConnectionCredentialAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string name = ""; ConnectionCredential credential = new ConnectionCredential(); // Make the request await connectionServiceClient.UpdateConnectionCredentialAsync(name, credential); }
/// <summary>Snippet for ListConnectionsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task ListConnectionsResourceNamesAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); uint? maxResults = 0U; // Make the request ListConnectionsResponse response = await connectionServiceClient.ListConnectionsAsync(parent, maxResults); }
/// <summary>Snippet for SetIamPolicyAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task SetIamPolicyAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string resource = "a/wildcard/resource"; Policy policy = new Policy(); // Make the request Policy response = await connectionServiceClient.SetIamPolicyAsync(resource, policy); }
/// <summary>Snippet for UpdateConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task UpdateConnectionAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string name = "projects/[PROJECT]/locations/[LOCATION]/connections/[CONNECTION]"; Connection connection = new Connection(); FieldMask updateMask = new FieldMask(); // Make the request Connection response = await connectionServiceClient.UpdateConnectionAsync(name, connection, updateMask); }
/// <summary>Snippet for UpdateConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task UpdateConnectionResourceNamesAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) ConnectionName name = ConnectionName.FromProjectLocationConnection("[PROJECT]", "[LOCATION]", "[CONNECTION]"); Connection connection = new Connection(); FieldMask updateMask = new FieldMask(); // Make the request Connection response = await connectionServiceClient.UpdateConnectionAsync(name, connection, updateMask); }
/// <summary>Snippet for CreateConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task CreateConnectionAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]"; Connection connection = new Connection(); string connectionId = ""; // Make the request Connection response = await connectionServiceClient.CreateConnectionAsync(parent, connection, connectionId); }
/// <summary>Snippet for CreateConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task CreateConnectionResourceNamesAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); Connection connection = new Connection(); string connectionId = ""; // Make the request Connection response = await connectionServiceClient.CreateConnectionAsync(parent, connection, connectionId); }
/// <summary>Snippet for DeleteConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task DeleteConnectionRequestObjectAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) DeleteConnectionRequest request = new DeleteConnectionRequest { ConnectionName = ConnectionName.FromProjectLocationConnection("[PROJECT]", "[LOCATION]", "[CONNECTION]"), }; // Make the request await connectionServiceClient.DeleteConnectionAsync(request); }
/// <summary>Snippet for TestIamPermissionsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task TestIamPermissionsRequestObjectAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) TestIamPermissionsRequest request = new TestIamPermissionsRequest { ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"), Permissions = { "", }, }; // Make the request TestIamPermissionsResponse response = await connectionServiceClient.TestIamPermissionsAsync(request); }
/// <summary>Snippet for UpdateConnectionCredentialAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task UpdateConnectionCredentialRequestObjectAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) UpdateConnectionCredentialRequest request = new UpdateConnectionCredentialRequest { Name = "", Credential = new ConnectionCredential(), }; // Make the request await connectionServiceClient.UpdateConnectionCredentialAsync(request); }
/// <summary>Snippet for DeleteConnectionAsync</summary> public async Task DeleteConnectionResourceNamesAsync() { // Snippet: DeleteConnectionAsync(ConnectionName, CallSettings) // Additional: DeleteConnectionAsync(ConnectionName, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) ConnectionName name = ConnectionName.FromProjectLocationConnection("[PROJECT]", "[LOCATION]", "[CONNECTION]"); // Make the request await connectionServiceClient.DeleteConnectionAsync(name); // End snippet }
/// <summary>Snippet for SetIamPolicyAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task SetIamPolicyRequestObjectAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) SetIamPolicyRequest request = new SetIamPolicyRequest { ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"), Policy = new Policy(), }; // Make the request Policy response = await connectionServiceClient.SetIamPolicyAsync(request); }
/// <summary>Snippet for DeleteConnectionAsync</summary> public async Task DeleteConnectionAsync() { // Snippet: DeleteConnectionAsync(string, CallSettings) // Additional: DeleteConnectionAsync(string, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string name = "projects/[PROJECT]/locations/[LOCATION]/connections/[CONNECTION]"; // Make the request await connectionServiceClient.DeleteConnectionAsync(name); // End snippet }
/// <summary>Snippet for UpdateConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task UpdateConnectionRequestObjectAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) UpdateConnectionRequest request = new UpdateConnectionRequest { ConnectionName = ConnectionName.FromProjectLocationConnection("[PROJECT]", "[LOCATION]", "[CONNECTION]"), Connection = new Connection(), UpdateMask = new FieldMask(), }; // Make the request Connection response = await connectionServiceClient.UpdateConnectionAsync(request); }
/// <summary>Snippet for ListConnectionsAsync</summary> public async Task ListConnectionsResourceNamesAsync() { // Snippet: ListConnectionsAsync(LocationName, uint?, CallSettings) // Additional: ListConnectionsAsync(LocationName, uint?, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); uint? maxResults = 0U; // Make the request ListConnectionsResponse response = await connectionServiceClient.ListConnectionsAsync(parent, maxResults); // End snippet }
/// <summary>Snippet for UpdateConnectionCredentialAsync</summary> public async Task UpdateConnectionCredentialAsync() { // Snippet: UpdateConnectionCredentialAsync(string, ConnectionCredential, CallSettings) // Additional: UpdateConnectionCredentialAsync(string, ConnectionCredential, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string name = ""; ConnectionCredential credential = new ConnectionCredential(); // Make the request await connectionServiceClient.UpdateConnectionCredentialAsync(name, credential); // End snippet }
/// <summary>Snippet for ListConnectionsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task ListConnectionsRequestObjectAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) ListConnectionsRequest request = new ListConnectionsRequest { ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), MaxResults = 0U, PageToken = "", }; // Make the request ListConnectionsResponse response = await connectionServiceClient.ListConnectionsAsync(request); }
/// <summary>Snippet for CreateConnectionAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task CreateConnectionRequestObjectAsync() { // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) CreateConnectionRequest request = new CreateConnectionRequest { ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), ConnectionId = "", Connection = new Connection(), }; // Make the request Connection response = await connectionServiceClient.CreateConnectionAsync(request); }
/// <summary>Snippet for TestIamPermissionsAsync</summary> public async Task TestIamPermissionsResourceNamesAsync() { // Snippet: TestIamPermissionsAsync(IResourceName, IEnumerable<string>, CallSettings) // Additional: TestIamPermissionsAsync(IResourceName, IEnumerable<string>, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <string> permissions = new string[] { "", }; // Make the request TestIamPermissionsResponse response = await connectionServiceClient.TestIamPermissionsAsync(resource, permissions); // End snippet }
/// <summary>Snippet for SetIamPolicyAsync</summary> public async Task SetIamPolicyResourceNamesAsync() { // Snippet: SetIamPolicyAsync(IResourceName, Policy, CallSettings) // Additional: SetIamPolicyAsync(IResourceName, Policy, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); Policy policy = new Policy(); // Make the request Policy response = await connectionServiceClient.SetIamPolicyAsync(resource, policy); // End snippet }
/// <summary>Snippet for GetIamPolicyAsync</summary> public async Task GetIamPolicyAsync() { // Snippet: GetIamPolicyAsync(string, GetPolicyOptions, CallSettings) // Additional: GetIamPolicyAsync(string, GetPolicyOptions, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string resource = "a/wildcard/resource"; GetPolicyOptions options = new GetPolicyOptions(); // Make the request Policy response = await connectionServiceClient.GetIamPolicyAsync(resource, options); // End snippet }
/// <summary>Snippet for ListConnectionsAsync</summary> public async Task ListConnectionsAsync() { // Snippet: ListConnectionsAsync(string, uint?, CallSettings) // Additional: ListConnectionsAsync(string, uint?, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]"; uint? maxResults = 0U; // Make the request ListConnectionsResponse response = await connectionServiceClient.ListConnectionsAsync(parent, maxResults); // End snippet }
/// <summary>Snippet for ListConnections</summary> public async Task ListConnectionsRequestObjectAsync() { // Snippet: ListConnectionsAsync(ListConnectionsRequest, CallSettings) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) ListConnectionsRequest request = new ListConnectionsRequest { ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), }; // Make the request PagedAsyncEnumerable <ListConnectionsResponse, Connection> response = connectionServiceClient.ListConnectionsAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Connection 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((ListConnectionsResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Connection 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 <Connection> 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 (Connection 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 CreateConnectionAsync</summary> public async Task CreateConnectionAsync() { // Snippet: CreateConnectionAsync(string, Connection, string, CallSettings) // Additional: CreateConnectionAsync(string, Connection, string, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]"; Connection connection = new Connection(); string connectionId = ""; // Make the request Connection response = await connectionServiceClient.CreateConnectionAsync(parent, connection, connectionId); // End snippet }
/// <summary>Snippet for UpdateConnectionAsync</summary> public async Task UpdateConnectionResourceNamesAsync() { // Snippet: UpdateConnectionAsync(ConnectionName, Connection, FieldMask, CallSettings) // Additional: UpdateConnectionAsync(ConnectionName, Connection, FieldMask, CancellationToken) // Create client ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync(); // Initialize request argument(s) ConnectionName name = ConnectionName.FromProjectLocationConnection("[PROJECT]", "[LOCATION]", "[CONNECTION]"); Connection connection = new Connection(); FieldMask updateMask = new FieldMask(); // Make the request Connection response = await connectionServiceClient.UpdateConnectionAsync(name, connection, updateMask); // End snippet }