Example #1
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, SslCertificate, CallSettings)
            // Additional: InsertAsync(string, SslCertificate, CancellationToken)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

            // Initialize request argument(s)
            string         project = "";
            SslCertificate sslCertificateResource = new SslCertificate();
            // Make the request
            lro::Operation <Operation, Operation> response = await sslCertificatesClient.InsertAsync(project, sslCertificateResource);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation <Operation, Operation> retrievedResponse = await sslCertificatesClient.PollOnceInsertAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListRequestObjectAsync()
        {
            // Snippet: AggregatedListAsync(AggregatedListSslCertificatesRequest, CallSettings)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

            // Initialize request argument(s)
            AggregatedListSslCertificatesRequest request = new AggregatedListSslCertificatesRequest
            {
                OrderBy              = "",
                Project              = "",
                Filter               = "",
                IncludeAllScopes     = false,
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <SslCertificateAggregatedList, KeyValuePair <string, SslCertificatesScopedList> > response = sslCertificatesClient.AggregatedListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((KeyValuePair <string, SslCertificatesScopedList> 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((SslCertificateAggregatedList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, SslCertificatesScopedList> 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 <KeyValuePair <string, SslCertificatesScopedList> > 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 (KeyValuePair <string, SslCertificatesScopedList> 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
        }
Example #3
0
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListAsync()
        {
            // Snippet: AggregatedListAsync(string, CallSettings)
            // Additional: AggregatedListAsync(string, CancellationToken)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            // Make the request
            SslCertificateAggregatedList response = await sslCertificatesClient.AggregatedListAsync(project);

            // End snippet
        }
Example #4
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, SslCertificate, CallSettings)
            // Additional: InsertAsync(string, SslCertificate, CancellationToken)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

            // Initialize request argument(s)
            string         project = "";
            SslCertificate sslCertificateResource = new SslCertificate();
            // Make the request
            Operation response = await sslCertificatesClient.InsertAsync(project, sslCertificateResource);

            // End snippet
        }
Example #5
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteAsync()
        {
            // Snippet: DeleteAsync(string, string, CallSettings)
            // Additional: DeleteAsync(string, string, CancellationToken)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

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

            // End snippet
        }
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListAsync()
        {
            // Snippet: ListAsync(string, string, int?, CallSettings)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedAsyncEnumerable <SslCertificateList, SslCertificate> response = sslCertificatesClient.ListAsync(project);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((SslCertificate 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((SslCertificateList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (SslCertificate 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 <SslCertificate> 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 (SslCertificate 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
        }
Example #7
0
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetSslCertificateRequest, CallSettings)
            // Additional: GetAsync(GetSslCertificateRequest, CancellationToken)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

            // Initialize request argument(s)
            GetSslCertificateRequest request = new GetSslCertificateRequest
            {
                SslCertificate = "",
                Project        = "",
            };
            // Make the request
            SslCertificate response = await sslCertificatesClient.GetAsync(request);

            // End snippet
        }
Example #8
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertSslCertificateRequest, CallSettings)
            // Additional: InsertAsync(InsertSslCertificateRequest, CancellationToken)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

            // Initialize request argument(s)
            InsertSslCertificateRequest request = new InsertSslCertificateRequest
            {
                RequestId = "",
                SslCertificateResource = new SslCertificate(),
                Project = "",
            };
            // Make the request
            Operation response = await sslCertificatesClient.InsertAsync(request);

            // End snippet
        }
Example #9
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteSslCertificateRequest, CallSettings)
            // Additional: DeleteAsync(DeleteSslCertificateRequest, CancellationToken)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

            // Initialize request argument(s)
            DeleteSslCertificateRequest request = new DeleteSslCertificateRequest
            {
                RequestId      = "",
                SslCertificate = "",
                Project        = "",
            };
            // Make the request
            Operation response = await sslCertificatesClient.DeleteAsync(request);

            // End snippet
        }
Example #10
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListSslCertificatesRequest, CallSettings)
            // Additional: ListAsync(ListSslCertificatesRequest, CancellationToken)
            // Create client
            SslCertificatesClient sslCertificatesClient = await SslCertificatesClient.CreateAsync();

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

            // End snippet
        }