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

            // Initialize request argument(s)
            string project  = "";
            string region   = "";
            string resource = "";
            RegionSetPolicyRequest regionSetPolicyRequestResource = new RegionSetPolicyRequest();
            // Make the request
            Policy response = await resourcePoliciesClient.SetIamPolicyAsync(project, region, resource, regionSetPolicyRequestResource);

            // End snippet
        }
Пример #2
0
        /// <summary>Snippet for SetIamPolicyAsync</summary>
        public async Task SetIamPolicyRequestObjectAsync()
        {
            // Snippet: SetIamPolicyAsync(SetIamPolicyResourcePolicyRequest, CallSettings)
            // Additional: SetIamPolicyAsync(SetIamPolicyResourcePolicyRequest, CancellationToken)
            // Create client
            ResourcePoliciesClient resourcePoliciesClient = await ResourcePoliciesClient.CreateAsync();

            // Initialize request argument(s)
            SetIamPolicyResourcePolicyRequest request = new SetIamPolicyResourcePolicyRequest
            {
                RegionSetPolicyRequestResource = new RegionSetPolicyRequest(),
                Region   = "",
                Resource = "",
                Project  = "",
            };
            // Make the request
            Policy response = await resourcePoliciesClient.SetIamPolicyAsync(request);

            // End snippet
        }