/// <summary>Snippet for PromoteCampaignDraft</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void PromoteCampaignDraftRequestObject()
        {
            // Create client
            CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
            // Initialize request argument(s)
            PromoteCampaignDraftRequest request = new PromoteCampaignDraftRequest
            {
                CampaignDraft = "",
                ValidateOnly  = false,
            };
            // Make the request
            Operation <Empty, Empty> response = campaignDraftServiceClient.PromoteCampaignDraft(request);

            // Poll until the returned long-running operation is complete
            Operation <Empty, Empty> completedResponse = response.PollUntilCompleted();
            // 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 = campaignDraftServiceClient.PollOncePromoteCampaignDraft(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;
            }
        }
Esempio n. 2
0
        /// <summary>Snippet for PromoteCampaignDraft</summary>
        public void PromoteCampaignDraft()
        {
            // Snippet: PromoteCampaignDraft(string, CallSettings)
            // Create client
            CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
            // Initialize request argument(s)
            string campaignDraft = "";
            // Make the request
            Operation <Empty, Empty> response = campaignDraftServiceClient.PromoteCampaignDraft(campaignDraft);

            // Poll until the returned long-running operation is complete
            Operation <Empty, Empty> completedResponse = response.PollUntilCompleted();
            // 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 = campaignDraftServiceClient.PollOncePromoteCampaignDraft(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
        }
 /// <summary>Snippet for GetCampaignDraft</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCampaignDraftResourceNames()
 {
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     CampaignDraftName resourceName = CampaignDraftName.FromCustomerBaseCampaignDraft("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]");
     // Make the request
     CampaignDraft response = campaignDraftServiceClient.GetCampaignDraft(resourceName);
 }
 /// <summary>Snippet for GetCampaignDraft</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCampaignDraft()
 {
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER]/campaignDrafts/[CAMPAIGN_DRAFT]";
     // Make the request
     CampaignDraft response = campaignDraftServiceClient.GetCampaignDraft(resourceName);
 }
Esempio n. 5
0
 /// <summary>Snippet for GetCampaignDraft</summary>
 public void GetCampaignDraftResourceNames()
 {
     // Snippet: GetCampaignDraft(CampaignDraftName, CallSettings)
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     CampaignDraftName resourceName = CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]");
     // Make the request
     CampaignDraft response = campaignDraftServiceClient.GetCampaignDraft(resourceName);
     // End snippet
 }
Esempio n. 6
0
 /// <summary>Snippet for GetCampaignDraft</summary>
 public void GetCampaignDraft()
 {
     // Snippet: GetCampaignDraft(string, CallSettings)
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER_ID]/campaignDrafts/[BASE_CAMPAIGN_ID]~[DRAFT_ID]";
     // Make the request
     CampaignDraft response = campaignDraftServiceClient.GetCampaignDraft(resourceName);
     // End snippet
 }
Esempio n. 7
0
 /// <summary>Snippet for GetCampaignDraft</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCampaignDraftRequestObject()
 {
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     GetCampaignDraftRequest request = new GetCampaignDraftRequest
     {
         ResourceNameAsCampaignDraftName = CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]"),
     };
     // Make the request
     CampaignDraft response = campaignDraftServiceClient.GetCampaignDraft(request);
 }
 /// <summary>Snippet for MutateCampaignDrafts</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateCampaignDrafts()
 {
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     string customerId = "";
     IEnumerable <CampaignDraftOperation> operations = new CampaignDraftOperation[]
     {
         new CampaignDraftOperation(),
     };
     // Make the request
     MutateCampaignDraftsResponse response = campaignDraftServiceClient.MutateCampaignDrafts(customerId, operations);
 }
Esempio n. 9
0
 /// <summary>Snippet for GetCampaignDraft</summary>
 public void GetCampaignDraftRequestObject()
 {
     // Snippet: GetCampaignDraft(GetCampaignDraftRequest, CallSettings)
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     GetCampaignDraftRequest request = new GetCampaignDraftRequest
     {
         ResourceNameAsCampaignDraftName = CampaignDraftName.FromCustomerBaseCampaignDraft("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]"),
     };
     // Make the request
     CampaignDraft response = campaignDraftServiceClient.GetCampaignDraft(request);
     // End snippet
 }
Esempio n. 10
0
        /// <summary>Snippet for ListCampaignDraftAsyncErrors</summary>
        public void ListCampaignDraftAsyncErrorsRequestObject()
        {
            // Snippet: ListCampaignDraftAsyncErrors(ListCampaignDraftAsyncErrorsRequest, CallSettings)
            // Create client
            CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
            // Initialize request argument(s)
            ListCampaignDraftAsyncErrorsRequest request = new ListCampaignDraftAsyncErrorsRequest
            {
                ResourceNameAsCampaignDraftName = CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]"),
            };
            // Make the request
            PagedEnumerable <ListCampaignDraftAsyncErrorsResponse, Status> response = campaignDraftServiceClient.ListCampaignDraftAsyncErrors(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Status item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListCampaignDraftAsyncErrorsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Status 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 <Status> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Status 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
        }
 /// <summary>Snippet for MutateCampaignDrafts</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateCampaignDraftsRequestObject()
 {
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     MutateCampaignDraftsRequest request = new MutateCampaignDraftsRequest
     {
         CustomerId = "",
         Operations =
         {
             new CampaignDraftOperation(),
         },
         PartialFailure = false,
         ValidateOnly   = false,
     };
     // Make the request
     MutateCampaignDraftsResponse response = campaignDraftServiceClient.MutateCampaignDrafts(request);
 }
        /// <summary>Snippet for ListCampaignDraftAsyncErrors</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ListCampaignDraftAsyncErrors()
        {
            // Create client
            CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER_ID]/campaignDrafts/[BASE_CAMPAIGN_ID]~[DRAFT_ID]";
            // Make the request
            PagedEnumerable <ListCampaignDraftAsyncErrorsResponse, Status> response = campaignDraftServiceClient.ListCampaignDraftAsyncErrors(resourceName);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Status item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListCampaignDraftAsyncErrorsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Status 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 <Status> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Status 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;
        }
Esempio n. 13
0
 /// <summary>Snippet for MutateCampaignDrafts</summary>
 public void MutateCampaignDraftsRequestObject()
 {
     // Snippet: MutateCampaignDrafts(MutateCampaignDraftsRequest, CallSettings)
     // Create client
     CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.Create();
     // Initialize request argument(s)
     MutateCampaignDraftsRequest request = new MutateCampaignDraftsRequest
     {
         CustomerId = "",
         Operations =
         {
             new CampaignDraftOperation(),
         },
         PartialFailure      = false,
         ValidateOnly        = false,
         ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
     };
     // Make the request
     MutateCampaignDraftsResponse response = campaignDraftServiceClient.MutateCampaignDrafts(request);
     // End snippet
 }