google-ads-googleads 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,51 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/ads/googleads/v0/services/ad_group_criterion_service.proto for package 'google.ads.googleads.v0.services'
3
+ # Original file comments:
4
+ # Copyright 2018 Google Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/ads/googleads/v0/services/ad_group_criterion_service_pb'
21
+
22
+ module Google
23
+ module Ads
24
+ module Googleads
25
+ module V0
26
+ module Services
27
+ module AdGroupCriterionService
28
+ # Proto file describing the Ad Group Criterion service.
29
+ #
30
+ # Service to manage ad group criteria.
31
+ class Service
32
+
33
+ include GRPC::GenericService
34
+
35
+ self.marshal_class_method = :encode
36
+ self.unmarshal_class_method = :decode
37
+ self.service_name = 'google.ads.googleads.v0.services.AdGroupCriterionService'
38
+
39
+ # Returns the requested criterion in full detail.
40
+ rpc :GetAdGroupCriterion, GetAdGroupCriterionRequest, Google::Ads::Googleads::V0::Resources::AdGroupCriterion
41
+ # Creates, updates, or removes criteria. Operation statuses are returned.
42
+ rpc :MutateAdGroupCriteria, MutateAdGroupCriteriaRequest, MutateAdGroupCriteriaResponse
43
+ end
44
+
45
+ Stub = Service.rpc_stub_class
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ 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_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_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 ad groups.
36
+ #
37
+ # @!attribute [r] ad_group_service_stub
38
+ # @return [Google::Ads::Googleads::V0::Services::AdGroupService::Stub]
39
+ class AdGroupServiceClient
40
+ attr_reader :ad_group_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_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
57
+ "customers/{customer}/adGroups/{ad_group}"
58
+ )
59
+
60
+ private_constant :AD_GROUP_PATH_TEMPLATE
61
+
62
+ # Returns a fully-qualified ad_group resource name string.
63
+ # @param customer [String]
64
+ # @param ad_group [String]
65
+ # @return [String]
66
+ def self.ad_group_path customer, ad_group
67
+ AD_GROUP_PATH_TEMPLATE.render(
68
+ :"customer" => customer,
69
+ :"ad_group" => ad_group
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_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_service_client_config.json"
147
+ )
148
+ defaults = client_config_file.open do |f|
149
+ Google::Gax.construct_settings(
150
+ "google.ads.googleads.v0.services.AdGroupService",
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_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::AdGroupService::Stub.method(:new)
171
+ )
172
+
173
+ @get_ad_group = Google::Gax.create_api_call(
174
+ @ad_group_service_stub.method(:get_ad_group),
175
+ defaults["get_ad_group"],
176
+ exception_transformer: exception_transformer
177
+ )
178
+ @mutate_ad_groups = Google::Gax.create_api_call(
179
+ @ad_group_service_stub.method(:mutate_ad_groups),
180
+ defaults["mutate_ad_groups"],
181
+ exception_transformer: exception_transformer
182
+ )
183
+ end
184
+
185
+ # Service calls
186
+
187
+ # Returns the requested ad group in full detail.
188
+ #
189
+ # @param resource_name [String]
190
+ # The resource name of the ad group 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::AdGroup]
196
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
197
+ # @return [Google::Ads::Googleads::V0::Resources::AdGroup]
198
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
199
+ # @example
200
+ # require "google/ads/googleads/v0/services"
201
+ #
202
+ # ad_group_service_client = Google::Ads::Googleads::V0::Services::AdGroup.new
203
+ # formatted_resource_name = Google::Ads::Googleads::V0::Services::AdGroupServiceClient.ad_group_path("[CUSTOMER]", "[AD_GROUP]")
204
+ # response = ad_group_service_client.get_ad_group(formatted_resource_name)
205
+
206
+ def get_ad_group \
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::GetAdGroupRequest)
214
+ @get_ad_group.call(req, options, &block)
215
+ end
216
+
217
+ # Creates, updates, or removes ad groups. Operation statuses are returned.
218
+ #
219
+ # @param customer_id [String]
220
+ # The ID of the customer whose ad groups are being modified.
221
+ # @param operations [Array<Google::Ads::Googleads::V0::Services::AdGroupOperation | Hash>]
222
+ # The list of operations to perform on individual ad groups.
223
+ # A hash of the same form as `Google::Ads::Googleads::V0::Services::AdGroupOperation`
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::MutateAdGroupsResponse]
230
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
231
+ # @return [Google::Ads::Googleads::V0::Services::MutateAdGroupsResponse]
232
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
233
+ # @example
234
+ # require "google/ads/googleads/v0/services"
235
+ #
236
+ # ad_group_service_client = Google::Ads::Googleads::V0::Services::AdGroup.new
237
+ #
238
+ # # TODO: Initialize +customer_id+:
239
+ # customer_id = ''
240
+ #
241
+ # # TODO: Initialize +operations+:
242
+ # operations = []
243
+ # response = ad_group_service_client.mutate_ad_groups(customer_id, operations)
244
+
245
+ def mutate_ad_groups \
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::MutateAdGroupsRequest)
255
+ @mutate_ad_groups.call(req, options, &block)
256
+ end
257
+ end
258
+ end
259
+ end
260
+ end
261
+ end
262
+ end
@@ -0,0 +1,36 @@
1
+ {
2
+ "interfaces": {
3
+ "google.ads.googleads.v0.services.AdGroupService": {
4
+ "retry_codes": {
5
+ "idempotent": [
6
+ "DEADLINE_EXCEEDED",
7
+ "UNAVAILABLE"
8
+ ],
9
+ "non_idempotent": []
10
+ },
11
+ "retry_params": {
12
+ "default": {
13
+ "initial_retry_delay_millis": 100,
14
+ "retry_delay_multiplier": 1.3,
15
+ "max_retry_delay_millis": 60000,
16
+ "initial_rpc_timeout_millis": 20000,
17
+ "rpc_timeout_multiplier": 1.0,
18
+ "max_rpc_timeout_millis": 20000,
19
+ "total_timeout_millis": 600000
20
+ }
21
+ },
22
+ "methods": {
23
+ "GetAdGroup": {
24
+ "timeout_millis": 60000,
25
+ "retry_codes_name": "idempotent",
26
+ "retry_params_name": "default"
27
+ },
28
+ "MutateAdGroups": {
29
+ "timeout_millis": 60000,
30
+ "retry_codes_name": "non_idempotent",
31
+ "retry_params_name": "default"
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,47 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/ads/googleads/v0/services/ad_group_service.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/ads/googleads/v0/resources/ad_group_pb'
7
+ require 'google/api/annotations_pb'
8
+ require 'google/protobuf/field_mask_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_message "google.ads.googleads.v0.services.GetAdGroupRequest" do
11
+ optional :resource_name, :string, 1
12
+ end
13
+ add_message "google.ads.googleads.v0.services.MutateAdGroupsRequest" do
14
+ optional :customer_id, :string, 1
15
+ repeated :operations, :message, 2, "google.ads.googleads.v0.services.AdGroupOperation"
16
+ end
17
+ add_message "google.ads.googleads.v0.services.AdGroupOperation" do
18
+ optional :update_mask, :message, 4, "google.protobuf.FieldMask"
19
+ oneof :operation do
20
+ optional :create, :message, 1, "google.ads.googleads.v0.resources.AdGroup"
21
+ optional :update, :message, 2, "google.ads.googleads.v0.resources.AdGroup"
22
+ optional :remove, :string, 3
23
+ end
24
+ end
25
+ add_message "google.ads.googleads.v0.services.MutateAdGroupsResponse" do
26
+ repeated :results, :message, 2, "google.ads.googleads.v0.services.MutateAdGroupResult"
27
+ end
28
+ add_message "google.ads.googleads.v0.services.MutateAdGroupResult" do
29
+ optional :resource_name, :string, 1
30
+ end
31
+ end
32
+
33
+ module Google
34
+ module Ads
35
+ module Googleads
36
+ module V0
37
+ module Services
38
+ GetAdGroupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.GetAdGroupRequest").msgclass
39
+ MutateAdGroupsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.MutateAdGroupsRequest").msgclass
40
+ AdGroupOperation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.AdGroupOperation").msgclass
41
+ MutateAdGroupsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.MutateAdGroupsResponse").msgclass
42
+ MutateAdGroupResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.MutateAdGroupResult").msgclass
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,51 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/ads/googleads/v0/services/ad_group_service.proto for package 'google.ads.googleads.v0.services'
3
+ # Original file comments:
4
+ # Copyright 2018 Google Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/ads/googleads/v0/services/ad_group_service_pb'
21
+
22
+ module Google
23
+ module Ads
24
+ module Googleads
25
+ module V0
26
+ module Services
27
+ module AdGroupService
28
+ # Proto file describing the Ad Group service.
29
+ #
30
+ # Service to manage ad groups.
31
+ class Service
32
+
33
+ include GRPC::GenericService
34
+
35
+ self.marshal_class_method = :encode
36
+ self.unmarshal_class_method = :decode
37
+ self.service_name = 'google.ads.googleads.v0.services.AdGroupService'
38
+
39
+ # Returns the requested ad group in full detail.
40
+ rpc :GetAdGroup, GetAdGroupRequest, Google::Ads::Googleads::V0::Resources::AdGroup
41
+ # Creates, updates, or removes ad groups. Operation statuses are returned.
42
+ rpc :MutateAdGroups, MutateAdGroupsRequest, MutateAdGroupsResponse
43
+ end
44
+
45
+ Stub = Service.rpc_stub_class
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end