/// <summary>Snippet for GetIamPolicy</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetIamPolicyResourceNames() { // Create client CloudBillingClient cloudBillingClient = CloudBillingClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = cloudBillingClient.GetIamPolicy(resource); }
/// <summary>Snippet for GetIamPolicy</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetIamPolicyResourceNames() { // Create client BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = bigtableInstanceAdminClient.GetIamPolicy(resource); }
/// <summary>Snippet for GetIamPolicy</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetIamPolicyResourceNames() { // Create client DataCatalogClient dataCatalogClient = DataCatalogClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = dataCatalogClient.GetIamPolicy(resource); }
public void Indexer() { var list = List("a", "b"); var resourceList = ResourceList(list); resourceList[1] = new UnparsedResourceName("c"); Assert.Equal("c", list[1]); Assert.Equal("a", resourceList[0].ToString()); }
public void TryParse() { UnparsedResourceName result; Assert.True(UnparsedResourceName.TryParse("a", out result)); Assert.Equal("a", result.ToString()); Assert.False(UnparsedResourceName.TryParse(null, out result)); Assert.False(UnparsedResourceName.TryParse("", out result)); }
/// <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 CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = await cloudBillingClient.GetIamPolicyAsync(resource); }
/// <summary>Snippet for TestIamPermissions</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void TestIamPermissionsResourceNames() { // Create client CloudBillingClient cloudBillingClient = CloudBillingClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <string> permissions = new string[] { "", }; // Make the request TestIamPermissionsResponse response = cloudBillingClient.TestIamPermissions(resource, permissions); }
/// <summary>Snippet for SetIamPolicy</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void SetIamPolicyResourceNames() { // Create client ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); Policy policy = new Policy(); // Make the request Policy response = connectionServiceClient.SetIamPolicy(resource, policy); }
/// <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 BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = await bigtableInstanceAdminClient.GetIamPolicyAsync(resource); }
/// <summary>Snippet for GetIamPolicy</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetIamPolicyResourceNames() { // Create client ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); GetPolicyOptions options = new GetPolicyOptions(); // Make the request Policy response = connectionServiceClient.GetIamPolicy(resource, options); }
/// <summary>Snippet for SetIamPolicy</summary> public void SetIamPolicyResourceNames() { // Snippet: SetIamPolicy(IResourceName, CallSettings) // Create client OrganizationsClient organizationsClient = OrganizationsClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = organizationsClient.SetIamPolicy(resource); // End snippet }
/// <summary>Snippet for GetAlertPolicy</summary> public void GetAlertPolicyResourceNames2() { // Snippet: GetAlertPolicy(IResourceName, CallSettings) // Create client AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.Create(); // Initialize request argument(s) IResourceName name = new UnparsedResourceName("a/wildcard/resource"); // Make the request AlertPolicy response = alertPolicyServiceClient.GetAlertPolicy(name); // End snippet }
/// <summary>Snippet for GetIamPolicy</summary> public void GetIamPolicyResourceNames() { // Snippet: GetIamPolicy(IResourceName, CallSettings) // Create client ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = containerAnalysisClient.GetIamPolicy(resource); // End snippet }
/// <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 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 SetIamPolicyResourceNamesAsync() { // 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); }
/// <summary>Snippet for TestIamPermissions</summary> public void TestIamPermissionsResourceNames() { // Snippet: TestIamPermissions(IResourceName, IEnumerable<string>, CallSettings) // Create client ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.Create(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <string> permissions = new string[] { "", }; // Make the request TestIamPermissionsResponse response = connectionServiceClient.TestIamPermissions(resource, permissions); // End snippet }
public void CopyTo() { var list = List("a", "b"); var resourceList = ResourceList(list); Assert.Throws <ArgumentNullException>(() => resourceList.CopyTo(null, 0)); UnparsedResourceName[] copy = new UnparsedResourceName[4]; Assert.Throws <ArgumentOutOfRangeException>(() => resourceList.CopyTo(copy, -1)); Assert.Throws <ArgumentException>(() => resourceList.CopyTo(copy, 3)); resourceList.CopyTo(copy, 1); Assert.Equal(new[] { null, new UnparsedResourceName("a"), new UnparsedResourceName("b"), null }, copy); }
/// <summary>Snippet for WildcardMultiPatternMultipleMethod</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void WildcardMultiPatternMultipleMethodResourceNames3() { // Create client ResourceNamesClient resourceNamesClient = ResourceNamesClient.Create(); // Initialize request argument(s) IResourceName @ref = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <WildcardMultiPatternMultipleName> repeatedRef = new WildcardMultiPatternMultipleName[] { WildcardMultiPatternMultipleName.FromConstPattern(), }; // Make the request Response response = resourceNamesClient.WildcardMultiPatternMultipleMethod(@ref, repeatedRef); }
/// <summary>Snippet for GetIamPolicyAsync</summary> public async Task GetIamPolicyResourceNamesAsync() { // Snippet: GetIamPolicyAsync(IResourceName, CallSettings) // Additional: GetIamPolicyAsync(IResourceName, CancellationToken) // Create client ContainerAnalysisClient containerAnalysisClient = await ContainerAnalysisClient.CreateAsync(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = await containerAnalysisClient.GetIamPolicyAsync(resource); // End snippet }
/// <summary>Snippet for WildcardMultiPatternMethod</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void WildcardMultiPatternMethodResourceNames5() { // Create client ResourceNamesClient resourceNamesClient = ResourceNamesClient.Create(); // Initialize request argument(s) IResourceName name = new UnparsedResourceName("a/wildcard/resource"); WildcardMultiPatternName @ref = WildcardMultiPatternName.FromSingularItem(); IEnumerable <WildcardMultiPatternName> repeatedRef = new WildcardMultiPatternName[] { WildcardMultiPatternName.FromSingularItem(), }; // Make the request Response response = resourceNamesClient.WildcardMultiPatternMethod(name, @ref, repeatedRef); }
/// <summary>Snippet for GetAlertPolicyAsync</summary> public async Task GetAlertPolicyResourceNames2Async() { // Snippet: GetAlertPolicyAsync(IResourceName, CallSettings) // Additional: GetAlertPolicyAsync(IResourceName, CancellationToken) // Create client AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync(); // Initialize request argument(s) IResourceName name = new UnparsedResourceName("a/wildcard/resource"); // Make the request AlertPolicy response = await alertPolicyServiceClient.GetAlertPolicyAsync(name); // End snippet }
/// <summary>Snippet for WildcardMultiPatternMultipleMethodAsync</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 WildcardMultiPatternMultipleMethodResourceNames4Async() { // Create client ResourceNamesClient resourceNamesClient = await ResourceNamesClient.CreateAsync(); // Initialize request argument(s) IResourceName @ref = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <IResourceName> repeatedRef = new IResourceName[] { new UnparsedResourceName("a/wildcard/resource"), }; // Make the request Response response = await resourceNamesClient.WildcardMultiPatternMultipleMethodAsync(@ref, repeatedRef); }
/// <summary>Snippet for WildcardMultiPatternMethodAsync</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 WildcardMultiPatternMethodResourceNames3Async() { // Create client ResourceNamesClient resourceNamesClient = await ResourceNamesClient.CreateAsync(); // Initialize request argument(s) WildcardMultiPatternName name = WildcardMultiPatternName.FromSingularItem(); IResourceName @ref = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <WildcardMultiPatternName> repeatedRef = new WildcardMultiPatternName[] { WildcardMultiPatternName.FromSingularItem(), }; // Make the request Response response = await resourceNamesClient.WildcardMultiPatternMethodAsync(name, @ref, repeatedRef); }
/// <summary>Snippet for WildcardMultiPatternMultipleMethod</summary> public void WildcardMultiPatternMultipleMethodResourceNames4() { // Snippet: WildcardMultiPatternMultipleMethod(IResourceName, IEnumerable<IResourceName>, CallSettings) // Create client ResourceNamesClient resourceNamesClient = ResourceNamesClient.Create(); // Initialize request argument(s) IResourceName @ref = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <IResourceName> repeatedRef = new IResourceName[] { new UnparsedResourceName("a/wildcard/resource"), }; // Make the request Response response = resourceNamesClient.WildcardMultiPatternMultipleMethod(@ref, repeatedRef); // End snippet }
/// <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 ListAlertPoliciesAsync</summary> public async Task ListAlertPoliciesResourceNames4Async() { // Snippet: ListAlertPoliciesAsync(IResourceName, string, int?, CallSettings) // Create client AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync(); // Initialize request argument(s) IResourceName name = new UnparsedResourceName("a/wildcard/resource"); // Make the request PagedAsyncEnumerable <ListAlertPoliciesResponse, AlertPolicy> response = alertPolicyServiceClient.ListAlertPoliciesAsync(name); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((AlertPolicy 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((ListAlertPoliciesResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (AlertPolicy 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 <AlertPolicy> 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 (AlertPolicy 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 WildcardMultiPatternMultipleMethodAsync</summary> public async Task WildcardMultiPatternMultipleMethodResourceNames4Async() { // Snippet: WildcardMultiPatternMultipleMethodAsync(IResourceName, IEnumerable<IResourceName>, CallSettings) // Additional: WildcardMultiPatternMultipleMethodAsync(IResourceName, IEnumerable<IResourceName>, CancellationToken) // Create client ResourceNamesClient resourceNamesClient = await ResourceNamesClient.CreateAsync(); // Initialize request argument(s) IResourceName @ref = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <IResourceName> repeatedRef = new IResourceName[] { new UnparsedResourceName("a/wildcard/resource"), }; // Make the request Response response = await resourceNamesClient.WildcardMultiPatternMultipleMethodAsync(@ref, repeatedRef); // End snippet }
/// <summary>Snippet for ListTagBindings</summary> public void ListTagBindingsResourceNames() { // Snippet: ListTagBindings(IResourceName, string, int?, CallSettings) // Create client TagBindingsClient tagBindingsClient = TagBindingsClient.Create(); // Initialize request argument(s) IResourceName parent = new UnparsedResourceName("a/wildcard/resource"); // Make the request PagedEnumerable <ListTagBindingsResponse, TagBinding> response = tagBindingsClient.ListTagBindings(parent); // Iterate over all response items, lazily performing RPCs as required foreach (TagBinding item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (ListTagBindingsResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (TagBinding 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 <TagBinding> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (TagBinding 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 WildcardOnlyPatternMethod</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void WildcardOnlyPatternMethodResourceNames() { // Create client ResourceNamesClient resourceNamesClient = ResourceNamesClient.Create(); // Initialize request argument(s) IResourceName name = new UnparsedResourceName("a/wildcard/resource"); IResourceName @ref = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <IResourceName> repeatedRef = new IResourceName[] { new UnparsedResourceName("a/wildcard/resource"), }; IResourceName refSugar = new UnparsedResourceName("a/wildcard/resource"); IEnumerable <IResourceName> repeatedRefSugar = new IResourceName[] { new UnparsedResourceName("a/wildcard/resource"), }; // Make the request Response response = resourceNamesClient.WildcardOnlyPatternMethod(name, @ref, repeatedRef, refSugar, repeatedRefSugar); }