Exemplo n.º 1
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteAsync()
        {
            // Snippet: DeleteAsync(string, string, CallSettings)
            // Additional: DeleteAsync(string, string, CancellationToken)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            string project       = "";
            string backendBucket = "";
            // Make the request
            Operation response = await backendBucketsClient.DeleteAsync(project, backendBucket);

            // End snippet
        }
Exemplo n.º 2
0
        /// <summary>Snippet for AddSignedUrlKeyAsync</summary>
        public async Task AddSignedUrlKeyAsync()
        {
            // Snippet: AddSignedUrlKeyAsync(string, string, SignedUrlKey, CallSettings)
            // Additional: AddSignedUrlKeyAsync(string, string, SignedUrlKey, CancellationToken)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            string       project              = "";
            string       backendBucket        = "";
            SignedUrlKey signedUrlKeyResource = new SignedUrlKey();
            // Make the request
            Operation response = await backendBucketsClient.AddSignedUrlKeyAsync(project, backendBucket, signedUrlKeyResource);

            // End snippet
        }
Exemplo n.º 3
0
        /// <summary>Snippet for PatchAsync</summary>
        public async Task PatchAsync()
        {
            // Snippet: PatchAsync(string, string, BackendBucket, CallSettings)
            // Additional: PatchAsync(string, string, BackendBucket, CancellationToken)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            string        project               = "";
            string        backendBucket         = "";
            BackendBucket backendBucketResource = new BackendBucket();
            // Make the request
            Operation response = await backendBucketsClient.PatchAsync(project, backendBucket, backendBucketResource);

            // End snippet
        }
Exemplo n.º 4
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListAsync()
        {
            // Snippet: ListAsync(string, string, int?, CallSettings)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedAsyncEnumerable <BackendBucketList, BackendBucket> response = backendBucketsClient.ListAsync(project);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((BackendBucket 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((BackendBucketList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (BackendBucket 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 <BackendBucket> 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 (BackendBucket 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
        }
Exemplo n.º 5
0
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetBackendBucketRequest, CallSettings)
            // Additional: GetAsync(GetBackendBucketRequest, CancellationToken)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            GetBackendBucketRequest request = new GetBackendBucketRequest
            {
                BackendBucket = "",
                Project       = "",
            };
            // Make the request
            BackendBucket response = await backendBucketsClient.GetAsync(request);

            // End snippet
        }
Exemplo n.º 6
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertBackendBucketRequest, CallSettings)
            // Additional: InsertAsync(InsertBackendBucketRequest, CancellationToken)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            InsertBackendBucketRequest request = new InsertBackendBucketRequest
            {
                RequestId             = "",
                Project               = "",
                BackendBucketResource = new BackendBucket(),
            };
            // Make the request
            Operation response = await backendBucketsClient.InsertAsync(request);

            // End snippet
        }
Exemplo n.º 7
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteBackendBucketRequest, CallSettings)
            // Additional: DeleteAsync(DeleteBackendBucketRequest, CancellationToken)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            DeleteBackendBucketRequest request = new DeleteBackendBucketRequest
            {
                RequestId     = "",
                BackendBucket = "",
                Project       = "",
            };
            // Make the request
            Operation response = await backendBucketsClient.DeleteAsync(request);

            // End snippet
        }
Exemplo n.º 8
0
        /// <summary>Snippet for AddSignedUrlKeyAsync</summary>
        public async Task AddSignedUrlKeyRequestObjectAsync()
        {
            // Snippet: AddSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest, CallSettings)
            // Additional: AddSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest, CancellationToken)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            AddSignedUrlKeyBackendBucketRequest request = new AddSignedUrlKeyBackendBucketRequest
            {
                RequestId            = "",
                BackendBucket        = "",
                Project              = "",
                SignedUrlKeyResource = new SignedUrlKey(),
            };
            // Make the request
            Operation response = await backendBucketsClient.AddSignedUrlKeyAsync(request);

            // End snippet
        }
Exemplo n.º 9
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListBackendBucketsRequest, CallSettings)
            // Additional: ListAsync(ListBackendBucketsRequest, CancellationToken)
            // Create client
            BackendBucketsClient backendBucketsClient = await BackendBucketsClient.CreateAsync();

            // Initialize request argument(s)
            ListBackendBucketsRequest request = new ListBackendBucketsRequest
            {
                PageToken            = "",
                MaxResults           = 0U,
                OrderBy              = "",
                Project              = "",
                Filter               = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            BackendBucketList response = await backendBucketsClient.ListAsync(request);

            // End snippet
        }