/// <summary>Snippet for PromoteCampaignDraftAsync</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 PromoteCampaignDraftAsync()
        {
            // Create client
            CampaignDraftServiceClient campaignDraftServiceClient = await CampaignDraftServiceClient.CreateAsync();

            // Initialize request argument(s)
            string campaignDraft = "";
            // Make the request
            Operation <Empty, Empty> response = await campaignDraftServiceClient.PromoteCampaignDraftAsync(campaignDraft);

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

            // Retrieve the operation result
            Empty 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 <Empty, Empty> retrievedResponse = await campaignDraftServiceClient.PollOncePromoteCampaignDraftAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
        }
Exemplo n.º 2
0
        /// <summary>Snippet for PromoteCampaignDraftAsync</summary>
        public async Task PromoteCampaignDraftRequestObjectAsync()
        {
            // Snippet: PromoteCampaignDraftAsync(PromoteCampaignDraftRequest, CallSettings)
            // Additional: PromoteCampaignDraftAsync(PromoteCampaignDraftRequest, CancellationToken)
            // Create client
            CampaignDraftServiceClient campaignDraftServiceClient = await CampaignDraftServiceClient.CreateAsync();

            // Initialize request argument(s)
            PromoteCampaignDraftRequest request = new PromoteCampaignDraftRequest {
                CampaignDraft = "",
            };
            // Make the request
            Operation <Empty, Empty> response = await campaignDraftServiceClient.PromoteCampaignDraftAsync(request);

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

            // Retrieve the operation result
            Empty 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 <Empty, Empty> retrievedResponse = await campaignDraftServiceClient.PollOncePromoteCampaignDraftAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }