Beispiel #1
0
        /// <summary>Snippet for SetIamPolicyAsync</summary>
        public async Task SetIamPolicyAsync()
        {
            // Snippet: SetIamPolicyAsync(IamResourceNameOneof,Policy,CallSettings)
            // Additional: SetIamPolicyAsync(IamResourceNameOneof,Policy,CancellationToken)
            // Create client
            ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = await ContainerAnalysisV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            IamResourceNameOneof resource = IamResourceNameOneof.From(new NoteName("[PROJECT]", "[NOTE]"));
            Policy policy = new Policy();
            // Make the request
            Policy response = await containerAnalysisV1Beta1Client.SetIamPolicyAsync(resource, policy);

            // End snippet
        }
Beispiel #2
0
        /// <summary>Snippet for SetIamPolicyAsync</summary>
        public async Task SetIamPolicyAsync_RequestObject()
        {
            // Snippet: SetIamPolicyAsync(SetIamPolicyRequest,CallSettings)
            // Additional: SetIamPolicyAsync(SetIamPolicyRequest,CancellationToken)
            // Create client
            ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = await ContainerAnalysisV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            SetIamPolicyRequest request = new SetIamPolicyRequest
            {
                ResourceAsIamResourceNameOneof = IamResourceNameOneof.From(new NoteName("[PROJECT]", "[NOTE]")),
                Policy = new Policy(),
            };
            // Make the request
            Policy response = await containerAnalysisV1Beta1Client.SetIamPolicyAsync(request);

            // End snippet
        }