Esempio n. 1
0
    public static async Task <Operation> PollUntilCompletedAsync(this Operation operation, string projectId)
    {
        GlobalOperationsClient operationsClient = await GlobalOperationsClient.CreateAsync();

        GetGlobalOperationRequest pollRequest = new GetGlobalOperationRequest
        {
            Operation = operation.Name,
            Project   = projectId,
        };

        async Task <Operation> Poller() => await operationsClient.GetAsync(pollRequest);

        return(await operation.PollUntilCompletedAsync(Poller));
    }
Esempio n. 2
0
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetAsync()
        {
            // Snippet: GetAsync(string, string, CallSettings)
            // Additional: GetAsync(string, string, CancellationToken)
            // Create client
            GlobalOperationsClient globalOperationsClient = await GlobalOperationsClient.CreateAsync();

            // Initialize request argument(s)
            string project   = "";
            string operation = "";
            // Make the request
            Operation response = await globalOperationsClient.GetAsync(project, operation);

            // End snippet
        }
Esempio n. 3
0
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetGlobalOperationRequest, CallSettings)
            // Additional: GetAsync(GetGlobalOperationRequest, CancellationToken)
            // Create client
            GlobalOperationsClient globalOperationsClient = await GlobalOperationsClient.CreateAsync();

            // Initialize request argument(s)
            GetGlobalOperationRequest request = new GetGlobalOperationRequest
            {
                Operation = "",
                Project   = "",
            };
            // Make the request
            Operation response = await globalOperationsClient.GetAsync(request);

            // End snippet
        }