/// <summary>Snippet for SubmitConfigSourceAsync</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 SubmitConfigSourceRequestObjectAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            SubmitConfigSourceRequest request = new SubmitConfigSourceRequest
            {
                ServiceName  = "",
                ConfigSource = new ConfigSource(),
                ValidateOnly = false,
            };
            // Make the request
            Operation <SubmitConfigSourceResponse, OperationMetadata> response = await serviceManagerClient.SubmitConfigSourceAsync(request);

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

            // Retrieve the operation result
            SubmitConfigSourceResponse 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
            Operation <SubmitConfigSourceResponse, OperationMetadata> retrievedResponse = await serviceManagerClient.PollOnceSubmitConfigSourceAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                SubmitConfigSourceResponse retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for UndeleteServiceAsync</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 UndeleteServiceAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            string serviceName = "";
            // Make the request
            Operation <UndeleteServiceResponse, OperationMetadata> response = await serviceManagerClient.UndeleteServiceAsync(serviceName);

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

            // Retrieve the operation result
            UndeleteServiceResponse 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
            Operation <UndeleteServiceResponse, OperationMetadata> retrievedResponse = await serviceManagerClient.PollOnceUndeleteServiceAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                UndeleteServiceResponse retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for GetServiceAsync</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 GetServiceAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            string serviceName = "";
            // Make the request
            ManagedService response = await serviceManagerClient.GetServiceAsync(serviceName);
        }
예제 #4
0
        /// <summary>Snippet for GetServiceRolloutAsync</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 GetServiceRolloutAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            string serviceName = "";
            string rolloutId   = "";
            // Make the request
            Rollout response = await serviceManagerClient.GetServiceRolloutAsync(serviceName, rolloutId);
        }
예제 #5
0
        /// <summary>Snippet for GenerateConfigReportAsync</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 GenerateConfigReportAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            Any newConfig = new Any();
            Any oldConfig = new Any();
            // Make the request
            GenerateConfigReportResponse response = await serviceManagerClient.GenerateConfigReportAsync(newConfig, oldConfig);
        }
        /// <summary>Snippet for CreateServiceConfigAsync</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 CreateServiceConfigAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            string  serviceName   = "";
            Service serviceConfig = new Service();
            // Make the request
            Service response = await serviceManagerClient.CreateServiceConfigAsync(serviceName, serviceConfig);
        }
        /// <summary>Snippet for GetServiceAsync</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 GetServiceRequestObjectAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            GetServiceRequest request = new GetServiceRequest {
                ServiceName = "",
            };
            // Make the request
            ManagedService response = await serviceManagerClient.GetServiceAsync(request);
        }
        /// <summary>Snippet for GetServiceConfigAsync</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 GetServiceConfigAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            string serviceName = "";
            string configId    = "";

            GetServiceConfigRequest.Types.ConfigView view = GetServiceConfigRequest.Types.ConfigView.Basic;
            // Make the request
            Service response = await serviceManagerClient.GetServiceConfigAsync(serviceName, configId, view);
        }
        /// <summary>Snippet for CreateServiceConfigAsync</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 CreateServiceConfigRequestObjectAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            CreateServiceConfigRequest request = new CreateServiceConfigRequest
            {
                ServiceName   = "",
                ServiceConfig = new Service(),
            };
            // Make the request
            Service response = await serviceManagerClient.CreateServiceConfigAsync(request);
        }
        /// <summary>Snippet for GenerateConfigReportAsync</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 GenerateConfigReportRequestObjectAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            GenerateConfigReportRequest request = new GenerateConfigReportRequest
            {
                NewConfig = new Any(),
                OldConfig = new Any(),
            };
            // Make the request
            GenerateConfigReportResponse response = await serviceManagerClient.GenerateConfigReportAsync(request);
        }
        /// <summary>Snippet for GetServiceConfigAsync</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 GetServiceConfigRequestObjectAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            GetServiceConfigRequest request = new GetServiceConfigRequest
            {
                ServiceName = "",
                ConfigId    = "",
                View        = GetServiceConfigRequest.Types.ConfigView.Basic,
            };
            // Make the request
            Service response = await serviceManagerClient.GetServiceConfigAsync(request);
        }
        /// <summary>Snippet for ListServicesAsync</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 ListServicesAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            string producerProjectId = "";
            string consumerId        = "";

            // Make the request
#pragma warning disable CS0612
            PagedAsyncEnumerable <ListServicesResponse, ManagedService> response = serviceManagerClient.ListServicesAsync(producerProjectId, consumerId);
#pragma warning restore CS0612

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((ManagedService 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((ListServicesResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (ManagedService 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 <ManagedService> 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 (ManagedService 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;
        }
        /// <summary>Snippet for ListServiceRolloutsAsync</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 ListServiceRolloutsRequestObjectAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            ListServiceRolloutsRequest request = new ListServiceRolloutsRequest
            {
                ServiceName = "",
                Filter      = "",
            };
            // Make the request
            PagedAsyncEnumerable <ListServiceRolloutsResponse, Rollout> response = serviceManagerClient.ListServiceRolloutsAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Rollout 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((ListServiceRolloutsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Rollout 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 <Rollout> 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 (Rollout 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;
        }
        /// <summary>Snippet for EnableServiceAsync</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 EnableServiceRequestObjectAsync()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();

            // Initialize request argument(s)
            EnableServiceRequest request = new EnableServiceRequest
            {
                ServiceName = "",
                ConsumerId  = "",
            };

            // Make the request
#pragma warning disable CS0612
            Operation <EnableServiceResponse, OperationMetadata> response = await serviceManagerClient.EnableServiceAsync(request);

#pragma warning restore CS0612

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

            // Retrieve the operation result
            EnableServiceResponse 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
#pragma warning disable CS0612
            Operation <EnableServiceResponse, OperationMetadata> retrievedResponse = await serviceManagerClient.PollOnceEnableServiceAsync(operationName);

#pragma warning restore CS0612
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                EnableServiceResponse retrievedResult = retrievedResponse.Result;
            }
        }