Пример #1
0
        /// <summary>Snippet for CreateApplicationAsync</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 CreateApplicationRequestObjectAsync()
        {
            // Create client
            ApplicationsClient applicationsClient = await ApplicationsClient.CreateAsync();

            // Initialize request argument(s)
            CreateApplicationRequest request = new CreateApplicationRequest
            {
                Application = new Application(),
            };
            // Make the request
            Operation <Application, OperationMetadataV1> response = await applicationsClient.CreateApplicationAsync(request);

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

            // Retrieve the operation result
            Application 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 <Application, OperationMetadataV1> retrievedResponse = await applicationsClient.PollOnceCreateApplicationAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Application retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for RepairApplicationAsync</summary>
        public async Task RepairApplicationRequestObjectAsync()
        {
            // Snippet: RepairApplicationAsync(RepairApplicationRequest, CallSettings)
            // Additional: RepairApplicationAsync(RepairApplicationRequest, CancellationToken)
            // Create client
            ApplicationsClient applicationsClient = await ApplicationsClient.CreateAsync();

            // Initialize request argument(s)
            RepairApplicationRequest request = new RepairApplicationRequest {
                Name = "",
            };
            // Make the request
            Operation <Application, OperationMetadataV1> response = await applicationsClient.RepairApplicationAsync(request);

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

            // Retrieve the operation result
            Application 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 <Application, OperationMetadataV1> retrievedResponse = await applicationsClient.PollOnceRepairApplicationAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Application retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Пример #3
0
        /// <summary>Snippet for GetApplicationAsync</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 GetApplicationRequestObjectAsync()
        {
            // Create client
            ApplicationsClient applicationsClient = await ApplicationsClient.CreateAsync();

            // Initialize request argument(s)
            GetApplicationRequest request = new GetApplicationRequest {
                Name = "",
            };
            // Make the request
            Application response = await applicationsClient.GetApplicationAsync(request);
        }
        /// <summary>Snippet for GetApplicationAsync</summary>
        public async Task GetApplicationRequestObjectAsync()
        {
            // Snippet: GetApplicationAsync(GetApplicationRequest, CallSettings)
            // Additional: GetApplicationAsync(GetApplicationRequest, CancellationToken)
            // Create client
            ApplicationsClient applicationsClient = await ApplicationsClient.CreateAsync();

            // Initialize request argument(s)
            GetApplicationRequest request = new GetApplicationRequest {
                Name = "",
            };
            // Make the request
            Application response = await applicationsClient.GetApplicationAsync(request);

            // End snippet
        }