/// <summary>Snippet for AddBatchJobOperations</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void AddBatchJobOperations2ResourceNames() { // Create client BatchJobServiceClient batchJobServiceClient = BatchJobServiceClient.Create(); // Initialize request argument(s) BatchJobName resourceName = BatchJobName.FromCustomerBatchJob("[CUSTOMER_ID]", "[BATCH_JOB_ID]"); IEnumerable <MutateOperation> mutateOperations = new MutateOperation[] { new MutateOperation(), }; // Make the request AddBatchJobOperationsResponse response = batchJobServiceClient.AddBatchJobOperations(resourceName, mutateOperations); }
/// <summary>Snippet for AddBatchJobOperations</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void AddBatchJobOperations2() { // Create client BatchJobServiceClient batchJobServiceClient = BatchJobServiceClient.Create(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER]/batchJobs/[BATCH_JOB]"; IEnumerable <MutateOperation> mutateOperations = new MutateOperation[] { new MutateOperation(), }; // Make the request AddBatchJobOperationsResponse response = batchJobServiceClient.AddBatchJobOperations(resourceName, mutateOperations); }
/// <summary>Snippet for AddBatchJobOperations</summary> public void AddBatchJobOperations1ResourceNames() { // Snippet: AddBatchJobOperations(BatchJobName, string, IEnumerable<MutateOperation>, CallSettings) // Create client BatchJobServiceClient batchJobServiceClient = BatchJobServiceClient.Create(); // Initialize request argument(s) BatchJobName resourceName = BatchJobName.FromCustomerBatchJob("[CUSTOMER]", "[BATCH_JOB]"); string sequenceToken = ""; IEnumerable <MutateOperation> mutateOperations = new MutateOperation[] { new MutateOperation(), }; // Make the request AddBatchJobOperationsResponse response = batchJobServiceClient.AddBatchJobOperations(resourceName, sequenceToken, mutateOperations); // End snippet }
/// <summary>Snippet for AddBatchJobOperations</summary> public void AddBatchJobOperations1() { // Snippet: AddBatchJobOperations(string, string, IEnumerable<MutateOperation>, CallSettings) // Create client BatchJobServiceClient batchJobServiceClient = BatchJobServiceClient.Create(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER_ID]/batchJobs/[BATCH_JOB_ID]"; string sequenceToken = ""; IEnumerable <MutateOperation> mutateOperations = new MutateOperation[] { new MutateOperation(), }; // Make the request AddBatchJobOperationsResponse response = batchJobServiceClient.AddBatchJobOperations(resourceName, sequenceToken, mutateOperations); // End snippet }
/// <summary>Snippet for AddBatchJobOperations</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void AddBatchJobOperationsRequestObject() { // Create client BatchJobServiceClient batchJobServiceClient = BatchJobServiceClient.Create(); // Initialize request argument(s) AddBatchJobOperationsRequest request = new AddBatchJobOperationsRequest { ResourceNameAsBatchJobName = BatchJobName.FromCustomerBatchJob("[CUSTOMER]", "[BATCH_JOB]"), SequenceToken = "", MutateOperations = { new MutateOperation(), }, }; // Make the request AddBatchJobOperationsResponse response = batchJobServiceClient.AddBatchJobOperations(request); }
/// <summary> /// Adds all batch job operations to the batch job. As this is the first time for this /// batch job, the sequence token is not set. The response will contain the next sequence /// token that you can use to upload more operations in the future. /// </summary> /// <param name="batchJobService">The batch job service.</param> /// <param name="customerId">The Google Ads customer ID for which the call is made.</param> /// <param name="batchJobResourceName">The resource name of batch job to which the batch /// job operations will be added. /// </param> private static void AddAllBatchJobOperations(BatchJobServiceClient batchJobService, long customerId, string batchJobResourceName) { AddBatchJobOperationsResponse response = batchJobService.AddBatchJobOperations( new AddBatchJobOperationsRequest() { ResourceName = batchJobResourceName, MutateOperations = { BuildAllOperations(customerId) } }); Console.WriteLine($"{response.TotalOperations} mutate operations have been added" + $" so far."); // You can use this next sequence token for calling AddBatchJobOperations() next time. Console.WriteLine($"Next sequence token for adding next operations is " + $"'{response.NextSequenceToken}'."); }