google-ads-googleads 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog +2 -0
  3. data/README.md +107 -0
  4. data/Rakefile +7 -0
  5. data/googleads_config.rb +10 -0
  6. data/lib/google/ads/googleads.rb +25 -0
  7. data/lib/google/ads/googleads/config.rb +42 -0
  8. data/lib/google/ads/googleads/errors.rb +40 -0
  9. data/lib/google/ads/googleads/field_mask_util.rb +159 -0
  10. data/lib/google/ads/googleads/googleads_client.rb +177 -0
  11. data/lib/google/ads/googleads/patches.rb +45 -0
  12. data/lib/google/ads/googleads/path_lookup_util.rb +84 -0
  13. data/lib/google/ads/googleads/proto_lookup_util.rb +249 -0
  14. data/lib/google/ads/googleads/v0/common/ad_pb.rb +80 -0
  15. data/lib/google/ads/googleads/v0/common/bidding_pb.rb +71 -0
  16. data/lib/google/ads/googleads/v0/common/criteria_pb.rb +25 -0
  17. data/lib/google/ads/googleads/v0/common/custom_parameter_pb.rb +24 -0
  18. data/lib/google/ads/googleads/v0/common/metrics_pb.rb +65 -0
  19. data/lib/google/ads/googleads/v0/common/policy_pb.rb +24 -0
  20. data/lib/google/ads/googleads/v0/common/value_pb.rb +28 -0
  21. data/lib/google/ads/googleads/v0/enums/ad_group_ad_status_pb.rb +29 -0
  22. data/lib/google/ads/googleads/v0/enums/ad_group_criterion_status_pb.rb +29 -0
  23. data/lib/google/ads/googleads/v0/enums/ad_group_status_pb.rb +29 -0
  24. data/lib/google/ads/googleads/v0/enums/ad_group_type_pb.rb +27 -0
  25. data/lib/google/ads/googleads/v0/enums/ad_network_type_pb.rb +31 -0
  26. data/lib/google/ads/googleads/v0/enums/ad_serving_optimization_status_pb.rb +31 -0
  27. data/lib/google/ads/googleads/v0/enums/ad_type_pb.rb +32 -0
  28. data/lib/google/ads/googleads/v0/enums/advertising_channel_sub_type_pb.rb +28 -0
  29. data/lib/google/ads/googleads/v0/enums/advertising_channel_type_pb.rb +27 -0
  30. data/lib/google/ads/googleads/v0/enums/bid_source_pb.rb +29 -0
  31. data/lib/google/ads/googleads/v0/enums/bidding_strategy_type_pb.rb +36 -0
  32. data/lib/google/ads/googleads/v0/enums/budget_delivery_method_pb.rb +28 -0
  33. data/lib/google/ads/googleads/v0/enums/budget_status_pb.rb +28 -0
  34. data/lib/google/ads/googleads/v0/enums/campaign_serving_status_pb.rb +31 -0
  35. data/lib/google/ads/googleads/v0/enums/campaign_status_pb.rb +29 -0
  36. data/lib/google/ads/googleads/v0/enums/criterion_type_pb.rb +27 -0
  37. data/lib/google/ads/googleads/v0/enums/day_of_week_pb.rb +33 -0
  38. data/lib/google/ads/googleads/v0/enums/device_pb.rb +29 -0
  39. data/lib/google/ads/googleads/v0/enums/google_ads_field_category_pb.rb +30 -0
  40. data/lib/google/ads/googleads/v0/enums/google_ads_field_data_type_pb.rb +36 -0
  41. data/lib/google/ads/googleads/v0/enums/keyword_match_type_pb.rb +29 -0
  42. data/lib/google/ads/googleads/v0/enums/page_one_promoted_strategy_goal_pb.rb +28 -0
  43. data/lib/google/ads/googleads/v0/enums/quality_score_bucket_pb.rb +29 -0
  44. data/lib/google/ads/googleads/v0/enums/slot_pb.rb +32 -0
  45. data/lib/google/ads/googleads/v0/errors/ad_customizer_error_pb.rb +31 -0
  46. data/lib/google/ads/googleads/v0/errors/ad_error_pb.rb +154 -0
  47. data/lib/google/ads/googleads/v0/errors/ad_group_ad_error_pb.rb +34 -0
  48. data/lib/google/ads/googleads/v0/errors/ad_group_criterion_error_pb.rb +63 -0
  49. data/lib/google/ads/googleads/v0/errors/ad_group_error_pb.rb +38 -0
  50. data/lib/google/ads/googleads/v0/errors/ad_sharing_error_pb.rb +29 -0
  51. data/lib/google/ads/googleads/v0/errors/adx_error_pb.rb +27 -0
  52. data/lib/google/ads/googleads/v0/errors/authentication_error_pb.rb +47 -0
  53. data/lib/google/ads/googleads/v0/errors/authorization_error_pb.rb +30 -0
  54. data/lib/google/ads/googleads/v0/errors/bidding_error_pb.rb +46 -0
  55. data/lib/google/ads/googleads/v0/errors/bidding_strategy_error_pb.rb +30 -0
  56. data/lib/google/ads/googleads/v0/errors/campaign_budget_error_pb.rb +40 -0
  57. data/lib/google/ads/googleads/v0/errors/campaign_criterion_error_pb.rb +36 -0
  58. data/lib/google/ads/googleads/v0/errors/campaign_error_pb.rb +60 -0
  59. data/lib/google/ads/googleads/v0/errors/collection_size_error_pb.rb +28 -0
  60. data/lib/google/ads/googleads/v0/errors/criterion_error_pb.rb +106 -0
  61. data/lib/google/ads/googleads/v0/errors/date_error_pb.rb +34 -0
  62. data/lib/google/ads/googleads/v0/errors/date_range_error_pb.rb +31 -0
  63. data/lib/google/ads/googleads/v0/errors/distinct_error_pb.rb +28 -0
  64. data/lib/google/ads/googleads/v0/errors/errors_pb.rb +154 -0
  65. data/lib/google/ads/googleads/v0/errors/feed_attribute_reference_error_pb.rb +29 -0
  66. data/lib/google/ads/googleads/v0/errors/field_mask_error_pb.rb +30 -0
  67. data/lib/google/ads/googleads/v0/errors/function_error_pb.rb +42 -0
  68. data/lib/google/ads/googleads/v0/errors/function_parsing_error_pb.rb +37 -0
  69. data/lib/google/ads/googleads/v0/errors/id_error_pb.rb +27 -0
  70. data/lib/google/ads/googleads/v0/errors/image_error_pb.rb +63 -0
  71. data/lib/google/ads/googleads/v0/errors/internal_error_pb.rb +28 -0
  72. data/lib/google/ads/googleads/v0/errors/list_operation_error_pb.rb +28 -0
  73. data/lib/google/ads/googleads/v0/errors/media_bundle_error_pb.rb +48 -0
  74. data/lib/google/ads/googleads/v0/errors/media_error_pb.rb +50 -0
  75. data/lib/google/ads/googleads/v0/errors/multiplier_error_pb.rb +38 -0
  76. data/lib/google/ads/googleads/v0/errors/mutate_error_pb.rb +31 -0
  77. data/lib/google/ads/googleads/v0/errors/new_resource_creation_error_pb.rb +29 -0
  78. data/lib/google/ads/googleads/v0/errors/not_empty_error_pb.rb +27 -0
  79. data/lib/google/ads/googleads/v0/errors/null_error_pb.rb +27 -0
  80. data/lib/google/ads/googleads/v0/errors/operation_access_denied_error_pb.rb +35 -0
  81. data/lib/google/ads/googleads/v0/errors/operator_error_pb.rb +27 -0
  82. data/lib/google/ads/googleads/v0/errors/query_error_pb.rb +72 -0
  83. data/lib/google/ads/googleads/v0/errors/quota_error_pb.rb +28 -0
  84. data/lib/google/ads/googleads/v0/errors/range_error_pb.rb +28 -0
  85. data/lib/google/ads/googleads/v0/errors/region_code_error_pb.rb +27 -0
  86. data/lib/google/ads/googleads/v0/errors/request_error_pb.rb +41 -0
  87. data/lib/google/ads/googleads/v0/errors/resource_access_denied_error_pb.rb +27 -0
  88. data/lib/google/ads/googleads/v0/errors/resource_count_limit_exceeded_error_pb.rb +33 -0
  89. data/lib/google/ads/googleads/v0/errors/setting_error_pb.rb +43 -0
  90. data/lib/google/ads/googleads/v0/errors/string_format_error_pb.rb +28 -0
  91. data/lib/google/ads/googleads/v0/errors/string_length_error_pb.rb +28 -0
  92. data/lib/google/ads/googleads/v0/errors/url_field_error_pb.rb +70 -0
  93. data/lib/google/ads/googleads/v0/resources/ad_group_ad_pb.rb +28 -0
  94. data/lib/google/ads/googleads/v0/resources/ad_group_criterion_pb.rb +64 -0
  95. data/lib/google/ads/googleads/v0/resources/ad_group_pb.rb +38 -0
  96. data/lib/google/ads/googleads/v0/resources/bidding_strategy_pb.rb +36 -0
  97. data/lib/google/ads/googleads/v0/resources/campaign_budget_pb.rb +32 -0
  98. data/lib/google/ads/googleads/v0/resources/campaign_criterion_pb.rb +32 -0
  99. data/lib/google/ads/googleads/v0/resources/campaign_pb.rb +70 -0
  100. data/lib/google/ads/googleads/v0/resources/customer_pb.rb +29 -0
  101. data/lib/google/ads/googleads/v0/resources/google_ads_field_pb.rb +38 -0
  102. data/lib/google/ads/googleads/v0/resources/keyword_view_pb.rb +22 -0
  103. data/lib/google/ads/googleads/v0/services/ad_group_ad_service_client.rb +262 -0
  104. data/lib/google/ads/googleads/v0/services/ad_group_ad_service_client_config.json +36 -0
  105. data/lib/google/ads/googleads/v0/services/ad_group_ad_service_pb.rb +47 -0
  106. data/lib/google/ads/googleads/v0/services/ad_group_ad_service_services_pb.rb +51 -0
  107. data/lib/google/ads/googleads/v0/services/ad_group_criterion_service_client.rb +262 -0
  108. data/lib/google/ads/googleads/v0/services/ad_group_criterion_service_client_config.json +36 -0
  109. data/lib/google/ads/googleads/v0/services/ad_group_criterion_service_pb.rb +47 -0
  110. data/lib/google/ads/googleads/v0/services/ad_group_criterion_service_services_pb.rb +51 -0
  111. data/lib/google/ads/googleads/v0/services/ad_group_service_client.rb +262 -0
  112. data/lib/google/ads/googleads/v0/services/ad_group_service_client_config.json +36 -0
  113. data/lib/google/ads/googleads/v0/services/ad_group_service_pb.rb +47 -0
  114. data/lib/google/ads/googleads/v0/services/ad_group_service_services_pb.rb +51 -0
  115. data/lib/google/ads/googleads/v0/services/bidding_strategy_service_client.rb +263 -0
  116. data/lib/google/ads/googleads/v0/services/bidding_strategy_service_client_config.json +36 -0
  117. data/lib/google/ads/googleads/v0/services/bidding_strategy_service_pb.rb +47 -0
  118. data/lib/google/ads/googleads/v0/services/bidding_strategy_service_services_pb.rb +52 -0
  119. data/lib/google/ads/googleads/v0/services/campaign_budget_service_client.rb +263 -0
  120. data/lib/google/ads/googleads/v0/services/campaign_budget_service_client_config.json +36 -0
  121. data/lib/google/ads/googleads/v0/services/campaign_budget_service_pb.rb +47 -0
  122. data/lib/google/ads/googleads/v0/services/campaign_budget_service_services_pb.rb +52 -0
  123. data/lib/google/ads/googleads/v0/services/campaign_criterion_service_client.rb +262 -0
  124. data/lib/google/ads/googleads/v0/services/campaign_criterion_service_client_config.json +36 -0
  125. data/lib/google/ads/googleads/v0/services/campaign_criterion_service_pb.rb +47 -0
  126. data/lib/google/ads/googleads/v0/services/campaign_criterion_service_services_pb.rb +51 -0
  127. data/lib/google/ads/googleads/v0/services/campaign_service_client.rb +262 -0
  128. data/lib/google/ads/googleads/v0/services/campaign_service_client_config.json +36 -0
  129. data/lib/google/ads/googleads/v0/services/campaign_service_pb.rb +47 -0
  130. data/lib/google/ads/googleads/v0/services/campaign_service_services_pb.rb +51 -0
  131. data/lib/google/ads/googleads/v0/services/credentials.rb +33 -0
  132. data/lib/google/ads/googleads/v0/services/customer_service_client.rb +214 -0
  133. data/lib/google/ads/googleads/v0/services/customer_service_client_config.json +31 -0
  134. data/lib/google/ads/googleads/v0/services/customer_service_pb.rb +24 -0
  135. data/lib/google/ads/googleads/v0/services/customer_service_services_pb.rb +49 -0
  136. data/lib/google/ads/googleads/v0/services/google_ads_field_service_client.rb +285 -0
  137. data/lib/google/ads/googleads/v0/services/google_ads_field_service_client_config.json +36 -0
  138. data/lib/google/ads/googleads/v0/services/google_ads_field_service_pb.rb +36 -0
  139. data/lib/google/ads/googleads/v0/services/google_ads_field_service_services_pb.rb +51 -0
  140. data/lib/google/ads/googleads/v0/services/google_ads_service_client.rb +242 -0
  141. data/lib/google/ads/googleads/v0/services/google_ads_service_client_config.json +31 -0
  142. data/lib/google/ads/googleads/v0/services/google_ads_service_pb.rb +72 -0
  143. data/lib/google/ads/googleads/v0/services/google_ads_service_services_pb.rb +49 -0
  144. data/lib/google/ads/googleads/v0/services/keyword_view_service_client.rb +216 -0
  145. data/lib/google/ads/googleads/v0/services/keyword_view_service_client_config.json +31 -0
  146. data/lib/google/ads/googleads/v0/services/keyword_view_service_pb.rb +24 -0
  147. data/lib/google/ads/googleads/v0/services/keyword_view_service_services_pb.rb +49 -0
  148. data/lib/google/ads/googleads/version.rb +25 -0
  149. data/lib/google/ads/googleads/wrapper_util.rb +48 -0
  150. metadata +248 -0
@@ -0,0 +1,38 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/resources/ad_group.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/ads/googleads/v0/common/custom_parameter_pb'
7
+ require 'google/ads/googleads/v0/enums/ad_group_status_pb'
8
+ require 'google/ads/googleads/v0/enums/ad_group_type_pb'
9
+ require 'google/protobuf/wrappers_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_message "google.ads.googleads.v0.resources.AdGroup" do
12
+ optional :resource_name, :string, 1
13
+ optional :id, :message, 3, "google.protobuf.Int64Value"
14
+ optional :name, :message, 4, "google.protobuf.StringValue"
15
+ optional :status, :enum, 5, "google.ads.googleads.v0.enums.AdGroupStatusEnum.AdGroupStatus"
16
+ optional :type, :enum, 12, "google.ads.googleads.v0.enums.AdGroupTypeEnum.AdGroupType"
17
+ optional :tracking_url_template, :message, 13, "google.protobuf.StringValue"
18
+ repeated :url_custom_parameters, :message, 6, "google.ads.googleads.v0.common.CustomParameter"
19
+ optional :campaign, :message, 10, "google.protobuf.StringValue"
20
+ optional :cpc_bid_micros, :message, 14, "google.protobuf.Int64Value"
21
+ optional :cpm_bid_micros, :message, 15, "google.protobuf.Int64Value"
22
+ optional :cpa_bid_micros, :message, 16, "google.protobuf.Int64Value"
23
+ optional :cpv_bid_micros, :message, 17, "google.protobuf.Int64Value"
24
+ optional :target_roas_override, :message, 19, "google.protobuf.DoubleValue"
25
+ end
26
+ end
27
+
28
+ module Google
29
+ module Ads
30
+ module Googleads
31
+ module V0
32
+ module Resources
33
+ AdGroup = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.AdGroup").msgclass
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,36 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/resources/bidding_strategy.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/ads/googleads/v0/common/bidding_pb'
7
+ require 'google/ads/googleads/v0/enums/bidding_strategy_type_pb'
8
+ require 'google/protobuf/wrappers_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_message "google.ads.googleads.v0.resources.BiddingStrategy" do
11
+ optional :resource_name, :string, 1
12
+ optional :id, :message, 3, "google.protobuf.Int64Value"
13
+ optional :name, :message, 4, "google.protobuf.StringValue"
14
+ optional :type, :enum, 5, "google.ads.googleads.v0.enums.BiddingStrategyTypeEnum.BiddingStrategyType"
15
+ oneof :scheme do
16
+ optional :enhanced_cpc, :message, 7, "google.ads.googleads.v0.common.EnhancedCpc"
17
+ optional :page_one_promoted, :message, 8, "google.ads.googleads.v0.common.PageOnePromoted"
18
+ optional :target_cpa, :message, 9, "google.ads.googleads.v0.common.TargetCpa"
19
+ optional :target_outrank_share, :message, 10, "google.ads.googleads.v0.common.TargetOutrankShare"
20
+ optional :target_roas, :message, 11, "google.ads.googleads.v0.common.TargetRoas"
21
+ optional :target_spend, :message, 12, "google.ads.googleads.v0.common.TargetSpend"
22
+ end
23
+ end
24
+ end
25
+
26
+ module Google
27
+ module Ads
28
+ module Googleads
29
+ module V0
30
+ module Resources
31
+ BiddingStrategy = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.BiddingStrategy").msgclass
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,32 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/resources/campaign_budget.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/ads/googleads/v0/enums/budget_delivery_method_pb'
7
+ require 'google/ads/googleads/v0/enums/budget_status_pb'
8
+ require 'google/protobuf/wrappers_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_message "google.ads.googleads.v0.resources.CampaignBudget" do
11
+ optional :resource_name, :string, 1
12
+ optional :id, :message, 3, "google.protobuf.Int64Value"
13
+ optional :name, :message, 4, "google.protobuf.StringValue"
14
+ optional :amount_micros, :message, 5, "google.protobuf.Int64Value"
15
+ optional :status, :enum, 6, "google.ads.googleads.v0.enums.BudgetStatusEnum.BudgetStatus"
16
+ optional :delivery_method, :enum, 7, "google.ads.googleads.v0.enums.BudgetDeliveryMethodEnum.BudgetDeliveryMethod"
17
+ optional :explicitly_shared, :message, 8, "google.protobuf.BoolValue"
18
+ optional :reference_count, :message, 9, "google.protobuf.Int64Value"
19
+ end
20
+ end
21
+
22
+ module Google
23
+ module Ads
24
+ module Googleads
25
+ module V0
26
+ module Resources
27
+ CampaignBudget = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.CampaignBudget").msgclass
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/resources/campaign_criterion.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/ads/googleads/v0/common/criteria_pb'
7
+ require 'google/ads/googleads/v0/enums/criterion_type_pb'
8
+ require 'google/protobuf/wrappers_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_message "google.ads.googleads.v0.resources.CampaignCriterion" do
11
+ optional :resource_name, :string, 1
12
+ optional :campaign, :message, 4, "google.protobuf.StringValue"
13
+ optional :criterion_id, :message, 5, "google.protobuf.Int64Value"
14
+ optional :negative, :message, 7, "google.protobuf.BoolValue"
15
+ optional :type, :enum, 6, "google.ads.googleads.v0.enums.CriterionTypeEnum.CriterionType"
16
+ oneof :criterion do
17
+ optional :keyword, :message, 8, "google.ads.googleads.v0.common.KeywordInfo"
18
+ end
19
+ end
20
+ end
21
+
22
+ module Google
23
+ module Ads
24
+ module Googleads
25
+ module V0
26
+ module Resources
27
+ CampaignCriterion = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.CampaignCriterion").msgclass
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,70 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/resources/campaign.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/ads/googleads/v0/common/bidding_pb'
7
+ require 'google/ads/googleads/v0/common/custom_parameter_pb'
8
+ require 'google/ads/googleads/v0/enums/ad_serving_optimization_status_pb'
9
+ require 'google/ads/googleads/v0/enums/advertising_channel_sub_type_pb'
10
+ require 'google/ads/googleads/v0/enums/advertising_channel_type_pb'
11
+ require 'google/ads/googleads/v0/enums/bidding_strategy_type_pb'
12
+ require 'google/ads/googleads/v0/enums/campaign_serving_status_pb'
13
+ require 'google/ads/googleads/v0/enums/campaign_status_pb'
14
+ require 'google/protobuf/wrappers_pb'
15
+ Google::Protobuf::DescriptorPool.generated_pool.build do
16
+ add_message "google.ads.googleads.v0.resources.Campaign" do
17
+ optional :resource_name, :string, 1
18
+ optional :id, :message, 3, "google.protobuf.Int64Value"
19
+ optional :name, :message, 4, "google.protobuf.StringValue"
20
+ optional :status, :enum, 5, "google.ads.googleads.v0.enums.CampaignStatusEnum.CampaignStatus"
21
+ optional :serving_status, :enum, 21, "google.ads.googleads.v0.enums.CampaignServingStatusEnum.CampaignServingStatus"
22
+ optional :ad_serving_optimization_status, :enum, 8, "google.ads.googleads.v0.enums.AdServingOptimizationStatusEnum.AdServingOptimizationStatus"
23
+ optional :advertising_channel_type, :enum, 9, "google.ads.googleads.v0.enums.AdvertisingChannelTypeEnum.AdvertisingChannelType"
24
+ optional :advertising_channel_sub_type, :enum, 10, "google.ads.googleads.v0.enums.AdvertisingChannelSubTypeEnum.AdvertisingChannelSubType"
25
+ optional :tracking_url_template, :message, 11, "google.protobuf.StringValue"
26
+ repeated :url_custom_parameters, :message, 12, "google.ads.googleads.v0.common.CustomParameter"
27
+ optional :network_settings, :message, 14, "google.ads.googleads.v0.resources.Campaign.NetworkSettings"
28
+ optional :dynamic_search_ads_setting, :message, 33, "google.ads.googleads.v0.resources.Campaign.DynamicSearchAdsSetting"
29
+ optional :campaign_budget, :message, 6, "google.protobuf.StringValue"
30
+ optional :bidding_strategy_type, :enum, 22, "google.ads.googleads.v0.enums.BiddingStrategyTypeEnum.BiddingStrategyType"
31
+ optional :start_date, :message, 19, "google.protobuf.StringValue"
32
+ optional :end_date, :message, 20, "google.protobuf.StringValue"
33
+ oneof :campaign_bidding_strategy do
34
+ optional :bidding_strategy, :message, 23, "google.protobuf.StringValue"
35
+ optional :manual_cpc, :message, 24, "google.ads.googleads.v0.common.ManualCpc"
36
+ optional :manual_cpm, :message, 25, "google.ads.googleads.v0.common.ManualCpm"
37
+ optional :maximize_conversions, :message, 30, "google.ads.googleads.v0.common.MaximizeConversions"
38
+ optional :maximize_conversion_value, :message, 31, "google.ads.googleads.v0.common.MaximizeConversionValue"
39
+ optional :target_cpa, :message, 26, "google.ads.googleads.v0.common.TargetCpa"
40
+ optional :target_roas, :message, 29, "google.ads.googleads.v0.common.TargetRoas"
41
+ optional :target_spend, :message, 27, "google.ads.googleads.v0.common.TargetSpend"
42
+ end
43
+ end
44
+ add_message "google.ads.googleads.v0.resources.Campaign.NetworkSettings" do
45
+ optional :target_google_search, :message, 1, "google.protobuf.BoolValue"
46
+ optional :target_search_network, :message, 2, "google.protobuf.BoolValue"
47
+ optional :target_content_network, :message, 3, "google.protobuf.BoolValue"
48
+ optional :target_partner_search_network, :message, 4, "google.protobuf.BoolValue"
49
+ end
50
+ add_message "google.ads.googleads.v0.resources.Campaign.DynamicSearchAdsSetting" do
51
+ optional :domain_name, :message, 1, "google.protobuf.StringValue"
52
+ optional :language_code, :message, 2, "google.protobuf.StringValue"
53
+ optional :use_supplied_urls_only, :message, 3, "google.protobuf.BoolValue"
54
+ repeated :feed_ids, :message, 4, "google.protobuf.Int64Value"
55
+ end
56
+ end
57
+
58
+ module Google
59
+ module Ads
60
+ module Googleads
61
+ module V0
62
+ module Resources
63
+ Campaign = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Campaign").msgclass
64
+ Campaign::NetworkSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Campaign.NetworkSettings").msgclass
65
+ Campaign::DynamicSearchAdsSetting = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Campaign.DynamicSearchAdsSetting").msgclass
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,29 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/resources/customer.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/protobuf/wrappers_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_message "google.ads.googleads.v0.resources.Customer" do
9
+ optional :resource_name, :string, 1
10
+ optional :id, :message, 3, "google.protobuf.Int64Value"
11
+ optional :descriptive_name, :message, 4, "google.protobuf.StringValue"
12
+ optional :currency_code, :message, 5, "google.protobuf.StringValue"
13
+ optional :time_zone, :message, 6, "google.protobuf.StringValue"
14
+ optional :tracking_url_template, :message, 7, "google.protobuf.StringValue"
15
+ optional :auto_tagging_enabled, :message, 8, "google.protobuf.BoolValue"
16
+ end
17
+ end
18
+
19
+ module Google
20
+ module Ads
21
+ module Googleads
22
+ module V0
23
+ module Resources
24
+ Customer = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Customer").msgclass
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,38 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/resources/google_ads_field.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/ads/googleads/v0/enums/google_ads_field_category_pb'
7
+ require 'google/ads/googleads/v0/enums/google_ads_field_data_type_pb'
8
+ require 'google/protobuf/wrappers_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_message "google.ads.googleads.v0.resources.GoogleAdsField" do
11
+ optional :resource_name, :string, 1
12
+ optional :name, :message, 2, "google.protobuf.StringValue"
13
+ optional :category, :enum, 3, "google.ads.googleads.v0.enums.GoogleAdsFieldCategoryEnum.GoogleAdsFieldCategory"
14
+ optional :selectable, :message, 4, "google.protobuf.BoolValue"
15
+ optional :filterable, :message, 5, "google.protobuf.BoolValue"
16
+ optional :sortable, :message, 6, "google.protobuf.BoolValue"
17
+ repeated :selectable_with, :message, 7, "google.protobuf.StringValue"
18
+ repeated :attribute_resources, :message, 8, "google.protobuf.StringValue"
19
+ repeated :metrics, :message, 9, "google.protobuf.StringValue"
20
+ repeated :segments, :message, 10, "google.protobuf.StringValue"
21
+ repeated :enum_values, :message, 11, "google.protobuf.StringValue"
22
+ optional :data_type, :enum, 12, "google.ads.googleads.v0.enums.GoogleAdsFieldDataTypeEnum.GoogleAdsFieldDataType"
23
+ optional :type_url, :message, 13, "google.protobuf.StringValue"
24
+ optional :is_repeated, :message, 14, "google.protobuf.BoolValue"
25
+ end
26
+ end
27
+
28
+ module Google
29
+ module Ads
30
+ module Googleads
31
+ module V0
32
+ module Resources
33
+ GoogleAdsField = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.GoogleAdsField").msgclass
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,22 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/resources/keyword_view.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.ads.googleads.v0.resources.KeywordView" do
8
+ optional :resource_name, :string, 1
9
+ end
10
+ end
11
+
12
+ module Google
13
+ module Ads
14
+ module Googleads
15
+ module V0
16
+ module Resources
17
+ KeywordView = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.KeywordView").msgclass
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,262 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #
15
+ # EDITING INSTRUCTIONS
16
+ # This file was generated from the file
17
+ # https://github.com/googleapis/googleapis/blob/master/google/ads/googleads/v0/services/ad_group_ad_service.proto,
18
+ # and updates to that file get reflected here through a refresh process.
19
+ # For the short term, the refresh process will only be runnable by Google
20
+ # engineers.
21
+
22
+ require "json"
23
+ require "pathname"
24
+
25
+ require "google/gax"
26
+
27
+ require "google/ads/googleads/v0/services/ad_group_ad_service_pb"
28
+ require "google/ads/googleads/v0/services/credentials"
29
+
30
+ module Google
31
+ module Ads
32
+ module Googleads
33
+ module V0
34
+ module Services
35
+ # Service to manage ads in an ad group.
36
+ #
37
+ # @!attribute [r] ad_group_ad_service_stub
38
+ # @return [Google::Ads::Googleads::V0::Services::AdGroupAdService::Stub]
39
+ class AdGroupAdServiceClient
40
+ attr_reader :ad_group_ad_service_stub
41
+
42
+ # The default address of the service.
43
+ SERVICE_ADDRESS = "googleads.googleapis.com".freeze
44
+
45
+ # The default port of the service.
46
+ DEFAULT_SERVICE_PORT = 443
47
+
48
+ DEFAULT_TIMEOUT = 30
49
+
50
+ # The scopes needed to make gRPC calls to all of the methods defined in
51
+ # this service.
52
+ ALL_SCOPES = [
53
+ ].freeze
54
+
55
+
56
+ AD_GROUP_AD_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
57
+ "customers/{customer}/adGroupAds/{ad_group_ad}"
58
+ )
59
+
60
+ private_constant :AD_GROUP_AD_PATH_TEMPLATE
61
+
62
+ # Returns a fully-qualified ad_group_ad resource name string.
63
+ # @param customer [String]
64
+ # @param ad_group_ad [String]
65
+ # @return [String]
66
+ def self.ad_group_ad_path customer, ad_group_ad
67
+ AD_GROUP_AD_PATH_TEMPLATE.render(
68
+ :"customer" => customer,
69
+ :"ad_group_ad" => ad_group_ad
70
+ )
71
+ end
72
+
73
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
74
+ # Provides the means for authenticating requests made by the client. This parameter can
75
+ # be many types.
76
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
77
+ # authenticating requests made by this client.
78
+ # A `String` will be treated as the path to the keyfile to be used for the construction of
79
+ # credentials for this client.
80
+ # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
81
+ # credentials for this client.
82
+ # A `GRPC::Core::Channel` will be used to make calls through.
83
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
84
+ # should already be composed with a `GRPC::Core::CallCredentials` object.
85
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
86
+ # metadata for requests, generally, to give OAuth credentials.
87
+ # @param scopes [Array<String>]
88
+ # The OAuth scopes for this service. This parameter is ignored if
89
+ # an updater_proc is supplied.
90
+ # @param client_config [Hash]
91
+ # A Hash for call options for each method. See
92
+ # Google::Gax#construct_settings for the structure of
93
+ # this data. Falls back to the default config if not specified
94
+ # or the specified config is missing data points.
95
+ # @param timeout [Numeric]
96
+ # The default timeout, in seconds, for calls made through this client.
97
+ # @param metadata [Hash]
98
+ # Default metadata to be sent with each request. This can be overridden on a per call basis.
99
+ # @param exception_transformer [Proc]
100
+ # An optional proc that intercepts any exceptions raised during an API call to inject
101
+ # custom error handling.
102
+ def initialize \
103
+ credentials: nil,
104
+ scopes: ALL_SCOPES,
105
+ client_config: {},
106
+ timeout: DEFAULT_TIMEOUT,
107
+ metadata: nil,
108
+ exception_transformer: nil,
109
+ lib_name: nil,
110
+ lib_version: ""
111
+ # These require statements are intentionally placed here to initialize
112
+ # the gRPC module only when it's required.
113
+ # See https://github.com/googleapis/toolkit/issues/446
114
+ require "google/gax/grpc"
115
+ require "google/ads/googleads/v0/services/ad_group_ad_service_services_pb"
116
+
117
+ credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default
118
+
119
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
120
+ updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc
121
+ end
122
+ if credentials.is_a?(GRPC::Core::Channel)
123
+ channel = credentials
124
+ end
125
+ if credentials.is_a?(GRPC::Core::ChannelCredentials)
126
+ chan_creds = credentials
127
+ end
128
+ if credentials.is_a?(Proc)
129
+ updater_proc = credentials
130
+ end
131
+ if credentials.is_a?(Google::Auth::Credentials)
132
+ updater_proc = credentials.updater_proc
133
+ end
134
+
135
+ package_version = Gem.loaded_specs['google-ads-googleads'].version.version
136
+
137
+ google_api_client = "gl-ruby/#{RUBY_VERSION}"
138
+ google_api_client << " #{lib_name}/#{lib_version}" if lib_name
139
+ google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
140
+ google_api_client << " grpc/#{GRPC::VERSION}"
141
+ google_api_client.freeze
142
+
143
+ headers = { :"x-goog-api-client" => google_api_client }
144
+ headers.merge!(metadata) unless metadata.nil?
145
+ client_config_file = Pathname.new(__dir__).join(
146
+ "ad_group_ad_service_client_config.json"
147
+ )
148
+ defaults = client_config_file.open do |f|
149
+ Google::Gax.construct_settings(
150
+ "google.ads.googleads.v0.services.AdGroupAdService",
151
+ JSON.parse(f.read),
152
+ client_config,
153
+ Google::Gax::Grpc::STATUS_CODE_NAMES,
154
+ timeout,
155
+ errors: Google::Gax::Grpc::API_ERRORS,
156
+ metadata: headers
157
+ )
158
+ end
159
+
160
+ # Allow overriding the service path/port in subclasses.
161
+ service_path = self.class::SERVICE_ADDRESS
162
+ port = self.class::DEFAULT_SERVICE_PORT
163
+ @ad_group_ad_service_stub = Google::Gax::Grpc.create_stub(
164
+ service_path,
165
+ port,
166
+ chan_creds: chan_creds,
167
+ channel: channel,
168
+ updater_proc: updater_proc,
169
+ scopes: scopes,
170
+ &Google::Ads::Googleads::V0::Services::AdGroupAdService::Stub.method(:new)
171
+ )
172
+
173
+ @get_ad_group_ad = Google::Gax.create_api_call(
174
+ @ad_group_ad_service_stub.method(:get_ad_group_ad),
175
+ defaults["get_ad_group_ad"],
176
+ exception_transformer: exception_transformer
177
+ )
178
+ @mutate_ad_group_ads = Google::Gax.create_api_call(
179
+ @ad_group_ad_service_stub.method(:mutate_ad_group_ads),
180
+ defaults["mutate_ad_group_ads"],
181
+ exception_transformer: exception_transformer
182
+ )
183
+ end
184
+
185
+ # Service calls
186
+
187
+ # Returns the requested ad in full detail.
188
+ #
189
+ # @param resource_name [String]
190
+ # The resource name of the ad to fetch.
191
+ # @param options [Google::Gax::CallOptions]
192
+ # Overrides the default settings for this call, e.g, timeout,
193
+ # retries, etc.
194
+ # @yield [result, operation] Access the result along with the RPC operation
195
+ # @yieldparam result [Google::Ads::Googleads::V0::Resources::AdGroupAd]
196
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
197
+ # @return [Google::Ads::Googleads::V0::Resources::AdGroupAd]
198
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
199
+ # @example
200
+ # require "google/ads/googleads/v0/services"
201
+ #
202
+ # ad_group_ad_service_client = Google::Ads::Googleads::V0::Services::AdGroupAd.new
203
+ # formatted_resource_name = Google::Ads::Googleads::V0::Services::AdGroupAdServiceClient.ad_group_ad_path("[CUSTOMER]", "[AD_GROUP_AD]")
204
+ # response = ad_group_ad_service_client.get_ad_group_ad(formatted_resource_name)
205
+
206
+ def get_ad_group_ad \
207
+ resource_name,
208
+ options: nil,
209
+ &block
210
+ req = {
211
+ resource_name: resource_name
212
+ }.delete_if { |_, v| v.nil? }
213
+ req = Google::Gax::to_proto(req, Google::Ads::Googleads::V0::Services::GetAdGroupAdRequest)
214
+ @get_ad_group_ad.call(req, options, &block)
215
+ end
216
+
217
+ # Creates, updates, or removes ads. Operation statuses are returned.
218
+ #
219
+ # @param customer_id [String]
220
+ # The ID of the customer whose ads are being modified.
221
+ # @param operations [Array<Google::Ads::Googleads::V0::Services::AdGroupAdOperation | Hash>]
222
+ # The list of operations to perform on individual ads.
223
+ # A hash of the same form as `Google::Ads::Googleads::V0::Services::AdGroupAdOperation`
224
+ # can also be provided.
225
+ # @param options [Google::Gax::CallOptions]
226
+ # Overrides the default settings for this call, e.g, timeout,
227
+ # retries, etc.
228
+ # @yield [result, operation] Access the result along with the RPC operation
229
+ # @yieldparam result [Google::Ads::Googleads::V0::Services::MutateAdGroupAdsResponse]
230
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
231
+ # @return [Google::Ads::Googleads::V0::Services::MutateAdGroupAdsResponse]
232
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
233
+ # @example
234
+ # require "google/ads/googleads/v0/services"
235
+ #
236
+ # ad_group_ad_service_client = Google::Ads::Googleads::V0::Services::AdGroupAd.new
237
+ #
238
+ # # TODO: Initialize +customer_id+:
239
+ # customer_id = ''
240
+ #
241
+ # # TODO: Initialize +operations+:
242
+ # operations = []
243
+ # response = ad_group_ad_service_client.mutate_ad_group_ads(customer_id, operations)
244
+
245
+ def mutate_ad_group_ads \
246
+ customer_id,
247
+ operations,
248
+ options: nil,
249
+ &block
250
+ req = {
251
+ customer_id: customer_id,
252
+ operations: operations
253
+ }.delete_if { |_, v| v.nil? }
254
+ req = Google::Gax::to_proto(req, Google::Ads::Googleads::V0::Services::MutateAdGroupAdsRequest)
255
+ @mutate_ad_group_ads.call(req, options, &block)
256
+ end
257
+ end
258
+ end
259
+ end
260
+ end
261
+ end
262
+ end