/// <summary>Snippet for GetCustomerExtensionSetting</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCustomerExtensionSetting()
 {
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER_ID]/customerExtensionSettings/[EXTENSION_TYPE]";
     // Make the request
     CustomerExtensionSetting response = customerExtensionSettingServiceClient.GetCustomerExtensionSetting(resourceName);
 }
 /// <summary>Snippet for GetCustomerExtensionSetting</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCustomerExtensionSettingResourceNames()
 {
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     CustomerExtensionSettingName resourceName = CustomerExtensionSettingName.FromCustomerExtensionType("[CUSTOMER_ID]", "[EXTENSION_TYPE]");
     // Make the request
     CustomerExtensionSetting response = customerExtensionSettingServiceClient.GetCustomerExtensionSetting(resourceName);
 }
        /// <summary>Snippet for GetCustomerExtensionSettingAsync</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 GetCustomerExtensionSettingResourceNamesAsync()
        {
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            CustomerExtensionSettingName resourceName = CustomerExtensionSettingName.FromCustomerCustomerExtensionSetting("[CUSTOMER]", "[CUSTOMER_EXTENSION_SETTING]");
            // Make the request
            CustomerExtensionSetting response = await customerExtensionSettingServiceClient.GetCustomerExtensionSettingAsync(resourceName);
        }
        /// <summary>Snippet for GetCustomerExtensionSettingAsync</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 GetCustomerExtensionSettingAsync()
        {
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/customerExtensionSettings/[CUSTOMER_EXTENSION_SETTING]";
            // Make the request
            CustomerExtensionSetting response = await customerExtensionSettingServiceClient.GetCustomerExtensionSettingAsync(resourceName);
        }
 /// <summary>Snippet for GetCustomerExtensionSetting</summary>
 public void GetCustomerExtensionSettingResourceNames()
 {
     // Snippet: GetCustomerExtensionSetting(CustomerExtensionSettingName, CallSettings)
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     CustomerExtensionSettingName resourceName = CustomerExtensionSettingName.FromCustomerCustomerExtensionSetting("[CUSTOMER]", "[CUSTOMER_EXTENSION_SETTING]");
     // Make the request
     CustomerExtensionSetting response = customerExtensionSettingServiceClient.GetCustomerExtensionSetting(resourceName);
     // End snippet
 }
 /// <summary>Snippet for GetCustomerExtensionSetting</summary>
 public void GetCustomerExtensionSetting()
 {
     // Snippet: GetCustomerExtensionSetting(string, CallSettings)
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER]/customerExtensionSettings/[CUSTOMER_EXTENSION_SETTING]";
     // Make the request
     CustomerExtensionSetting response = customerExtensionSettingServiceClient.GetCustomerExtensionSetting(resourceName);
     // End snippet
 }
 /// <summary>Snippet for GetCustomerExtensionSetting</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCustomerExtensionSettingRequestObject()
 {
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     GetCustomerExtensionSettingRequest request = new GetCustomerExtensionSettingRequest
     {
         ResourceNameAsCustomerExtensionSettingName = CustomerExtensionSettingName.FromCustomerCustomerExtensionSetting("[CUSTOMER]", "[CUSTOMER_EXTENSION_SETTING]"),
     };
     // Make the request
     CustomerExtensionSetting response = customerExtensionSettingServiceClient.GetCustomerExtensionSetting(request);
 }
 /// <summary>Snippet for MutateCustomerExtensionSettings</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateCustomerExtensionSettings()
 {
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     string customerId = "";
     IEnumerable <CustomerExtensionSettingOperation> operations = new CustomerExtensionSettingOperation[]
     {
         new CustomerExtensionSettingOperation(),
     };
     // Make the request
     MutateCustomerExtensionSettingsResponse response = customerExtensionSettingServiceClient.MutateCustomerExtensionSettings(customerId, operations);
 }
        /// <summary>Snippet for GetCustomerExtensionSettingAsync</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 GetCustomerExtensionSettingRequestObjectAsync()
        {
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetCustomerExtensionSettingRequest request = new GetCustomerExtensionSettingRequest
            {
                ResourceNameAsCustomerExtensionSettingName = CustomerExtensionSettingName.FromCustomerExtensionType("[CUSTOMER_ID]", "[EXTENSION_TYPE]"),
            };
            // Make the request
            CustomerExtensionSetting response = await customerExtensionSettingServiceClient.GetCustomerExtensionSettingAsync(request);
        }
        /// <summary>Snippet for GetCustomerExtensionSettingAsync</summary>
        public async Task GetCustomerExtensionSettingAsync()
        {
            // Snippet: GetCustomerExtensionSettingAsync(string, CallSettings)
            // Additional: GetCustomerExtensionSettingAsync(string, CancellationToken)
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/customerExtensionSettings/[CUSTOMER_EXTENSION_SETTING]";
            // Make the request
            CustomerExtensionSetting response = await customerExtensionSettingServiceClient.GetCustomerExtensionSettingAsync(resourceName);

            // End snippet
        }
 /// <summary>Snippet for GetCustomerExtensionSetting</summary>
 public void GetCustomerExtensionSettingRequestObject()
 {
     // Snippet: GetCustomerExtensionSetting(GetCustomerExtensionSettingRequest, CallSettings)
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     GetCustomerExtensionSettingRequest request = new GetCustomerExtensionSettingRequest
     {
         ResourceNameAsCustomerExtensionSettingName = CustomerExtensionSettingName.FromCustomerExtensionType("[CUSTOMER_ID]", "[EXTENSION_TYPE]"),
     };
     // Make the request
     CustomerExtensionSetting response = customerExtensionSettingServiceClient.GetCustomerExtensionSetting(request);
     // End snippet
 }
        /// <summary>Snippet for GetCustomerExtensionSettingAsync</summary>
        public async Task GetCustomerExtensionSettingResourceNamesAsync()
        {
            // Snippet: GetCustomerExtensionSettingAsync(CustomerExtensionSettingName, CallSettings)
            // Additional: GetCustomerExtensionSettingAsync(CustomerExtensionSettingName, CancellationToken)
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            CustomerExtensionSettingName resourceName = CustomerExtensionSettingName.FromCustomerExtensionType("[CUSTOMER_ID]", "[EXTENSION_TYPE]");
            // Make the request
            CustomerExtensionSetting response = await customerExtensionSettingServiceClient.GetCustomerExtensionSettingAsync(resourceName);

            // End snippet
        }
Exemplo n.º 13
0
        /// <summary>
        /// Runs the code example.
        /// </summary>
        /// <param name="client">The Google Ads client.</param>
        /// <param name="customerId">The customer ID for which the call is made.</param>
        /// <param name="campaignId">ID of the campaign to targeting are added.</param>
        public void Run(GoogleAdsClient client, long customerId, long campaignId)
        {
            // Get the CustomerExtensionSettingServiceClient.
            CustomerExtensionSettingServiceClient customerExtensionSettingService =
                client.GetService(Services.V4.CustomerExtensionSettingService);

            try
            {
                // Creates an extension feed item as price.
                string extensionFeedItemResourceName =
                    CreateExtensionFeedItem(client, customerId, campaignId);

                // Creates a customer extension setting using the previously created extension
                // feed item. This associates the price extension to your account.
                CustomerExtensionSetting customerExtensionSetting =
                    new CustomerExtensionSetting()
                {
                    ExtensionType      = ExtensionType.Price,
                    ExtensionFeedItems = { extensionFeedItemResourceName }
                };

                // Creates an operation to add the extension setting.
                CustomerExtensionSettingOperation operation =
                    new CustomerExtensionSettingOperation()
                {
                    Create = customerExtensionSetting
                };

                // Issues a mutate request to add the customer extension setting
                // and prints its information.
                MutateCustomerExtensionSettingsResponse response =
                    customerExtensionSettingService.MutateCustomerExtensionSettings(
                        customerId.ToString(), new[] { operation });

                foreach (MutateCustomerExtensionSettingResult result in response.Results)
                {
                    Console.WriteLine("Created customer extension setting with resource name: " +
                                      result.ResourceName);
                }
            }
            catch (GoogleAdsException e)
            {
                Console.WriteLine("Failure:");
                Console.WriteLine($"Message: {e.Message}");
                Console.WriteLine($"Failure: {e.Failure}");
                Console.WriteLine($"Request ID: {e.RequestId}");
                throw;
            }
        }
        /// <summary>Snippet for GetCustomerExtensionSettingAsync</summary>
        public async Task GetCustomerExtensionSettingRequestObjectAsync()
        {
            // Snippet: GetCustomerExtensionSettingAsync(GetCustomerExtensionSettingRequest, CallSettings)
            // Additional: GetCustomerExtensionSettingAsync(GetCustomerExtensionSettingRequest, CancellationToken)
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetCustomerExtensionSettingRequest request = new GetCustomerExtensionSettingRequest
            {
                ResourceNameAsCustomerExtensionSettingName = CustomerExtensionSettingName.FromCustomerCustomerExtensionSetting("[CUSTOMER]", "[CUSTOMER_EXTENSION_SETTING]"),
            };
            // Make the request
            CustomerExtensionSetting response = await customerExtensionSettingServiceClient.GetCustomerExtensionSettingAsync(request);

            // End snippet
        }
        /// <summary>Snippet for MutateCustomerExtensionSettingsAsync</summary>
        public async Task MutateCustomerExtensionSettingsAsync()
        {
            // Snippet: MutateCustomerExtensionSettingsAsync(string, IEnumerable<CustomerExtensionSettingOperation>, CallSettings)
            // Additional: MutateCustomerExtensionSettingsAsync(string, IEnumerable<CustomerExtensionSettingOperation>, CancellationToken)
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            string customerId = "";
            IEnumerable <CustomerExtensionSettingOperation> operations = new CustomerExtensionSettingOperation[]
            {
                new CustomerExtensionSettingOperation(),
            };
            // Make the request
            MutateCustomerExtensionSettingsResponse response = await customerExtensionSettingServiceClient.MutateCustomerExtensionSettingsAsync(customerId, operations);

            // End snippet
        }
 /// <summary>Snippet for MutateCustomerExtensionSettings</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateCustomerExtensionSettingsRequestObject()
 {
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     MutateCustomerExtensionSettingsRequest request = new MutateCustomerExtensionSettingsRequest
     {
         CustomerId = "",
         Operations =
         {
             new CustomerExtensionSettingOperation(),
         },
         PartialFailure = false,
         ValidateOnly   = false,
     };
     // Make the request
     MutateCustomerExtensionSettingsResponse response = customerExtensionSettingServiceClient.MutateCustomerExtensionSettings(request);
 }
        /// <summary>Snippet for MutateCustomerExtensionSettingsAsync</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 MutateCustomerExtensionSettingsRequestObjectAsync()
        {
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateCustomerExtensionSettingsRequest request = new MutateCustomerExtensionSettingsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new CustomerExtensionSettingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = false,
                ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
            };
            // Make the request
            MutateCustomerExtensionSettingsResponse response = await customerExtensionSettingServiceClient.MutateCustomerExtensionSettingsAsync(request);
        }
Exemplo n.º 18
0
 /// <summary>Snippet for MutateCustomerExtensionSettings</summary>
 public void MutateCustomerExtensionSettingsRequestObject()
 {
     // Snippet: MutateCustomerExtensionSettings(MutateCustomerExtensionSettingsRequest, CallSettings)
     // Create client
     CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = CustomerExtensionSettingServiceClient.Create();
     // Initialize request argument(s)
     MutateCustomerExtensionSettingsRequest request = new MutateCustomerExtensionSettingsRequest
     {
         CustomerId = "",
         Operations =
         {
             new CustomerExtensionSettingOperation(),
         },
         PartialFailure      = false,
         ValidateOnly        = false,
         ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
     };
     // Make the request
     MutateCustomerExtensionSettingsResponse response = customerExtensionSettingServiceClient.MutateCustomerExtensionSettings(request);
     // End snippet
 }
        /// <summary>Snippet for MutateCustomerExtensionSettingsAsync</summary>
        public async Task MutateCustomerExtensionSettingsRequestObjectAsync()
        {
            // Snippet: MutateCustomerExtensionSettingsAsync(MutateCustomerExtensionSettingsRequest, CallSettings)
            // Additional: MutateCustomerExtensionSettingsAsync(MutateCustomerExtensionSettingsRequest, CancellationToken)
            // Create client
            CustomerExtensionSettingServiceClient customerExtensionSettingServiceClient = await CustomerExtensionSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateCustomerExtensionSettingsRequest request = new MutateCustomerExtensionSettingsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new CustomerExtensionSettingOperation(),
                },
                PartialFailure = false,
                ValidateOnly   = false,
            };
            // Make the request
            MutateCustomerExtensionSettingsResponse response = await customerExtensionSettingServiceClient.MutateCustomerExtensionSettingsAsync(request);

            // End snippet
        }