Esempio n. 1
0
        /// <summary>Snippet for DeleteAttestorAsync</summary>
        public async Task DeleteAttestorResourceNamesAsync()
        {
            // Snippet: DeleteAttestorAsync(AttestorName, CallSettings)
            // Additional: DeleteAttestorAsync(AttestorName, CancellationToken)
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            AttestorName name = AttestorName.FromProjectAttestor("[PROJECT]", "[ATTESTOR]");
            // Make the request
            await binauthzManagementServiceV1Beta1Client.DeleteAttestorAsync(name);

            // End snippet
        }
Esempio n. 2
0
        /// <summary>Snippet for GetPolicyAsync</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 GetPolicyAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/policy";
            // Make the request
            Policy response = await binauthzManagementServiceV1Beta1Client.GetPolicyAsync(name);
        }
Esempio n. 3
0
        /// <summary>Snippet for GetPolicyAsync</summary>
        public async Task GetPolicyAsync()
        {
            // Snippet: GetPolicyAsync(string, CallSettings)
            // Additional: GetPolicyAsync(string, CancellationToken)
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/policy";
            // Make the request
            Policy response = await binauthzManagementServiceV1Beta1Client.GetPolicyAsync(name);

            // End snippet
        }
Esempio n. 4
0
        /// <summary>Snippet for DeleteAttestorAsync</summary>
        public async Task DeleteAttestorAsync()
        {
            // Snippet: DeleteAttestorAsync(string, CallSettings)
            // Additional: DeleteAttestorAsync(string, CancellationToken)
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/attestors/[ATTESTOR]";
            // Make the request
            await binauthzManagementServiceV1Beta1Client.DeleteAttestorAsync(name);

            // End snippet
        }
        /// <summary>Snippet for GetAttestorAsync</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 GetAttestorAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/attestors/[ATTESTOR]";
            // Make the request
            Attestor response = await binauthzManagementServiceV1Beta1Client.GetAttestorAsync(name);
        }
        /// <summary>Snippet for UpdatePolicyAsync</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 UpdatePolicyRequestObjectAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            UpdatePolicyRequest request = new UpdatePolicyRequest
            {
                Policy = new Policy(),
            };
            // Make the request
            Policy response = await binauthzManagementServiceV1Beta1Client.UpdatePolicyAsync(request);
        }
Esempio n. 7
0
        /// <summary>Snippet for CreateAttestorAsync</summary>
        public async Task CreateAttestorRequestObjectAsync()
        {
            // Snippet: CreateAttestorAsync(CreateAttestorRequest, CallSettings)
            // Additional: CreateAttestorAsync(CreateAttestorRequest, CancellationToken)
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            CreateAttestorRequest request = new CreateAttestorRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                AttestorId          = "",
                Attestor            = new Attestor(),
            };
            // Make the request
            Attestor response = await binauthzManagementServiceV1Beta1Client.CreateAttestorAsync(request);

            // End snippet
        }
        /// <summary>Snippet for DeleteAttestorAsync</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 DeleteAttestorResourceNamesAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            AttestorName name = AttestorName.FromProjectAttestor("[PROJECT]", "[ATTESTOR]");
            // Make the request
            await binauthzManagementServiceV1Beta1Client.DeleteAttestorAsync(name);
        }
Esempio n. 9
0
        /// <summary>Snippet for CreateAttestorAsync</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 CreateAttestorRequestObjectAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            CreateAttestorRequest request = new CreateAttestorRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                AttestorId          = "",
                Attestor            = new Attestor(),
            };
            // Make the request
            Attestor response = await binauthzManagementServiceV1Beta1Client.CreateAttestorAsync(request);
        }
Esempio n. 10
0
        /// <summary>Snippet for UpdatePolicyAsync</summary>
        public async Task UpdatePolicyAsync()
        {
            // Snippet: UpdatePolicyAsync(Policy, CallSettings)
            // Additional: UpdatePolicyAsync(Policy, CancellationToken)
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            Policy policy = new Policy();
            // Make the request
            Policy response = await binauthzManagementServiceV1Beta1Client.UpdatePolicyAsync(policy);

            // End snippet
        }
        /// <summary>Snippet for UpdatePolicyAsync</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 UpdatePolicyAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            Policy policy = new Policy();
            // Make the request
            Policy response = await binauthzManagementServiceV1Beta1Client.UpdatePolicyAsync(policy);
        }
Esempio n. 12
0
        /// <summary>Snippet for UpdateAttestorAsync</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 UpdateAttestorAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            Attestor attestor = new Attestor();
            // Make the request
            Attestor response = await binauthzManagementServiceV1Beta1Client.UpdateAttestorAsync(attestor);
        }
        /// <summary>Snippet for CreateAttestorAsync</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 CreateAttestorResourceNamesAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            ProjectName parent     = ProjectName.FromProject("[PROJECT]");
            string      attestorId = "";
            Attestor    attestor   = new Attestor();
            // Make the request
            Attestor response = await binauthzManagementServiceV1Beta1Client.CreateAttestorAsync(parent, attestorId, attestor);
        }
Esempio n. 14
0
        /// <summary>Snippet for UpdateAttestorAsync</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 UpdateAttestorRequestObjectAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            UpdateAttestorRequest request = new UpdateAttestorRequest
            {
                Attestor = new Attestor(),
            };
            // Make the request
            Attestor response = await binauthzManagementServiceV1Beta1Client.UpdateAttestorAsync(request);
        }
Esempio n. 15
0
        /// <summary>Snippet for CreateAttestorAsync</summary>
        public async Task CreateAttestorResourceNamesAsync()
        {
            // Snippet: CreateAttestorAsync(ProjectName, string, Attestor, CallSettings)
            // Additional: CreateAttestorAsync(ProjectName, string, Attestor, CancellationToken)
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            ProjectName parent     = ProjectName.FromProject("[PROJECT]");
            string      attestorId = "";
            Attestor    attestor   = new Attestor();
            // Make the request
            Attestor response = await binauthzManagementServiceV1Beta1Client.CreateAttestorAsync(parent, attestorId, attestor);

            // End snippet
        }
Esempio n. 16
0
        /// <summary>Snippet for ListAttestorsAsync</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 ListAttestorsAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            string parent = "projects/[PROJECT]";
            // Make the request
            PagedAsyncEnumerable <ListAttestorsResponse, Attestor> response = binauthzManagementServiceV1Beta1Client.ListAttestorsAsync(parent);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Attestor 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((ListAttestorsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Attestor 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 <Attestor> 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 (Attestor 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;
        }
Esempio n. 17
0
        /// <summary>Snippet for UpdateAttestorAsync</summary>
        public async Task UpdateAttestorAsync()
        {
            // Snippet: UpdateAttestorAsync(Attestor, CallSettings)
            // Additional: UpdateAttestorAsync(Attestor, CancellationToken)
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            Attestor attestor = new Attestor();
            // Make the request
            Attestor response = await binauthzManagementServiceV1Beta1Client.UpdateAttestorAsync(attestor);

            // End snippet
        }
Esempio n. 18
0
        /// <summary>Snippet for GetPolicyAsync</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 GetPolicyRequestObjectAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            GetPolicyRequest request = new GetPolicyRequest
            {
                PolicyName = PolicyName.FromProject("[PROJECT]"),
            };
            // Make the request
            Policy response = await binauthzManagementServiceV1Beta1Client.GetPolicyAsync(request);
        }
Esempio n. 19
0
        /// <summary>Snippet for GetPolicyAsync</summary>
        public async Task GetPolicyRequestObjectAsync()
        {
            // Snippet: GetPolicyAsync(GetPolicyRequest, CallSettings)
            // Additional: GetPolicyAsync(GetPolicyRequest, CancellationToken)
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            GetPolicyRequest request = new GetPolicyRequest
            {
                PolicyName = PolicyName.FromProject("[PROJECT]"),
            };
            // Make the request
            Policy response = await binauthzManagementServiceV1Beta1Client.GetPolicyAsync(request);

            // End snippet
        }
Esempio n. 20
0
        /// <summary>Snippet for DeleteAttestorAsync</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 DeleteAttestorRequestObjectAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            DeleteAttestorRequest request = new DeleteAttestorRequest
            {
                AttestorName = AttestorName.FromProjectAttestor("[PROJECT]", "[ATTESTOR]"),
            };
            // Make the request
            await binauthzManagementServiceV1Beta1Client.DeleteAttestorAsync(request);
        }
        /// <summary>Snippet for GetPolicyAsync</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 GetPolicyResourceNamesAsync()
        {
            // Create client
            BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client = await BinauthzManagementServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            PolicyName name = PolicyName.FromProject("[PROJECT]");
            // Make the request
            Policy response = await binauthzManagementServiceV1Beta1Client.GetPolicyAsync(name);
        }