google-ads-ad_manager-v1 4.0.0 → 4.2.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 (216) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/ads/ad_manager/v1/ad_break_service/rest/client.rb +7 -5
  4. data/lib/google/ads/ad_manager/v1/ad_review_center_ad_service/rest/client.rb +5 -3
  5. data/lib/google/ads/ad_manager/v1/ad_review_center_ad_service/rest/operations.rb +2 -0
  6. data/lib/google/ads/ad_manager/v1/ad_rule_service/credentials.rb +48 -0
  7. data/lib/google/ads/ad_manager/v1/ad_rule_service/paths.rb +421 -0
  8. data/lib/google/ads/ad_manager/v1/ad_rule_service/rest/client.rb +1174 -0
  9. data/lib/google/ads/ad_manager/v1/ad_rule_service/rest/service_stub.rb +637 -0
  10. data/lib/google/ads/ad_manager/v1/ad_rule_service/rest.rb +52 -0
  11. data/lib/google/ads/ad_manager/v1/ad_rule_service.rb +48 -0
  12. data/lib/google/ads/ad_manager/v1/ad_spot_service/credentials.rb +48 -0
  13. data/lib/google/ads/ad_manager/v1/ad_spot_service/paths.rb +64 -0
  14. data/lib/google/ads/ad_manager/v1/ad_spot_service/rest/client.rb +908 -0
  15. data/lib/google/ads/ad_manager/v1/ad_spot_service/rest/service_stub.rb +451 -0
  16. data/lib/google/ads/ad_manager/v1/ad_spot_service/rest.rb +52 -0
  17. data/lib/google/ads/ad_manager/v1/ad_spot_service.rb +48 -0
  18. data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/client.rb +10 -8
  19. data/lib/google/ads/ad_manager/v1/application_service/rest/client.rb +10 -8
  20. data/lib/google/ads/ad_manager/v1/audience_segment_service/rest/client.rb +2 -0
  21. data/lib/google/ads/ad_manager/v1/bandwidth_group_service/rest/client.rb +4 -2
  22. data/lib/google/ads/ad_manager/v1/browser_language_service/rest/client.rb +4 -2
  23. data/lib/google/ads/ad_manager/v1/browser_service/rest/client.rb +4 -2
  24. data/lib/google/ads/ad_manager/v1/cdn_config_service/credentials.rb +48 -0
  25. data/lib/google/ads/ad_manager/v1/cdn_config_service/paths.rb +64 -0
  26. data/lib/google/ads/ad_manager/v1/cdn_config_service/rest/client.rb +1085 -0
  27. data/lib/google/ads/ad_manager/v1/cdn_config_service/rest/service_stub.rb +575 -0
  28. data/lib/google/ads/ad_manager/v1/cdn_config_service/rest.rb +52 -0
  29. data/lib/google/ads/ad_manager/v1/cdn_config_service.rb +48 -0
  30. data/lib/google/ads/ad_manager/v1/cms_metadata_key_service/rest/client.rb +6 -4
  31. data/lib/google/ads/ad_manager/v1/cms_metadata_value_service/rest/client.rb +6 -4
  32. data/lib/google/ads/ad_manager/v1/company_service/rest/client.rb +2 -0
  33. data/lib/google/ads/ad_manager/v1/contact_service/rest/client.rb +2 -0
  34. data/lib/google/ads/ad_manager/v1/content_bundle_service/rest/client.rb +6 -2
  35. data/lib/google/ads/ad_manager/v1/content_label_service/rest/client.rb +4 -2
  36. data/lib/google/ads/ad_manager/v1/content_service/rest/client.rb +17 -2
  37. data/lib/google/ads/ad_manager/v1/creative_template_service/rest/client.rb +4 -2
  38. data/lib/google/ads/ad_manager/v1/custom_field_service/rest/client.rb +8 -6
  39. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/client.rb +9 -7
  40. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/paths.rb +17 -0
  41. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/client.rb +542 -2
  42. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/service_stub.rb +372 -0
  43. data/lib/google/ads/ad_manager/v1/device_capability_service/rest/client.rb +4 -2
  44. data/lib/google/ads/ad_manager/v1/device_category_service/rest/client.rb +4 -2
  45. data/lib/google/ads/ad_manager/v1/device_manufacturer_service/rest/client.rb +4 -2
  46. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/client.rb +2 -0
  47. data/lib/google/ads/ad_manager/v1/geo_target_service/rest/client.rb +4 -2
  48. data/lib/google/ads/ad_manager/v1/label_service/rest/client.rb +10 -8
  49. data/lib/google/ads/ad_manager/v1/line_item_service/rest/client.rb +4 -2
  50. data/lib/google/ads/ad_manager/v1/linked_device_service/rest/client.rb +2 -0
  51. data/lib/google/ads/ad_manager/v1/live_stream_service/credentials.rb +48 -0
  52. data/lib/google/ads/ad_manager/v1/live_stream_service/paths.rb +81 -0
  53. data/lib/google/ads/ad_manager/v1/live_stream_service/rest/client.rb +1356 -0
  54. data/lib/google/ads/ad_manager/v1/live_stream_service/rest/service_stub.rb +761 -0
  55. data/lib/google/ads/ad_manager/v1/live_stream_service/rest.rb +52 -0
  56. data/lib/google/ads/ad_manager/v1/live_stream_service.rb +48 -0
  57. data/lib/google/ads/ad_manager/v1/mcm_earnings_service/rest/client.rb +2 -0
  58. data/lib/google/ads/ad_manager/v1/mobile_carrier_service/rest/client.rb +4 -2
  59. data/lib/google/ads/ad_manager/v1/mobile_device_service/rest/client.rb +4 -2
  60. data/lib/google/ads/ad_manager/v1/mobile_device_submodel_service/rest/client.rb +4 -2
  61. data/lib/google/ads/ad_manager/v1/network_service/rest/client.rb +2 -0
  62. data/lib/google/ads/ad_manager/v1/operating_system_service/rest/client.rb +4 -2
  63. data/lib/google/ads/ad_manager/v1/operating_system_version_service/rest/client.rb +4 -2
  64. data/lib/google/ads/ad_manager/v1/order_service/rest/client.rb +4 -2
  65. data/lib/google/ads/ad_manager/v1/placement_service/rest/client.rb +8 -6
  66. data/lib/google/ads/ad_manager/v1/private_auction_deal_service/rest/client.rb +6 -4
  67. data/lib/google/ads/ad_manager/v1/private_auction_service/rest/client.rb +6 -4
  68. data/lib/google/ads/ad_manager/v1/programmatic_buyer_service/rest/client.rb +4 -2
  69. data/lib/google/ads/ad_manager/v1/report_service/rest/client.rb +2 -0
  70. data/lib/google/ads/ad_manager/v1/report_service/rest/operations.rb +2 -0
  71. data/lib/google/ads/ad_manager/v1/rest.rb +7 -0
  72. data/lib/google/ads/ad_manager/v1/rich_media_ads_company_service/rest/client.rb +4 -2
  73. data/lib/google/ads/ad_manager/v1/role_service/rest/client.rb +2 -0
  74. data/lib/google/ads/ad_manager/v1/site_service/rest/client.rb +2 -0
  75. data/lib/google/ads/ad_manager/v1/suggested_ad_unit_service/credentials.rb +48 -0
  76. data/lib/google/ads/ad_manager/v1/suggested_ad_unit_service/paths.rb +64 -0
  77. data/lib/google/ads/ad_manager/v1/suggested_ad_unit_service/rest/client.rb +635 -0
  78. data/lib/google/ads/ad_manager/v1/suggested_ad_unit_service/rest/service_stub.rb +265 -0
  79. data/lib/google/ads/ad_manager/v1/suggested_ad_unit_service/rest.rb +52 -0
  80. data/lib/google/ads/ad_manager/v1/suggested_ad_unit_service.rb +48 -0
  81. data/lib/google/ads/ad_manager/v1/targeting_preset_service/credentials.rb +48 -0
  82. data/lib/google/ads/ad_manager/v1/targeting_preset_service/paths.rb +421 -0
  83. data/lib/google/ads/ad_manager/v1/targeting_preset_service/rest/client.rb +816 -0
  84. data/lib/google/ads/ad_manager/v1/targeting_preset_service/rest/service_stub.rb +389 -0
  85. data/lib/google/ads/ad_manager/v1/targeting_preset_service/rest.rb +52 -0
  86. data/lib/google/ads/ad_manager/v1/targeting_preset_service.rb +48 -0
  87. data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/client.rb +2 -0
  88. data/lib/google/ads/ad_manager/v1/team_service/rest/client.rb +2 -0
  89. data/lib/google/ads/ad_manager/v1/third_party_company_service/credentials.rb +48 -0
  90. data/lib/google/ads/ad_manager/v1/third_party_company_service/paths.rb +64 -0
  91. data/lib/google/ads/ad_manager/v1/third_party_company_service/rest/client.rb +550 -0
  92. data/lib/google/ads/ad_manager/v1/third_party_company_service/rest/service_stub.rb +203 -0
  93. data/lib/google/ads/ad_manager/v1/third_party_company_service/rest.rb +53 -0
  94. data/lib/google/ads/ad_manager/v1/third_party_company_service.rb +49 -0
  95. data/lib/google/ads/ad_manager/v1/user_service/rest/client.rb +2 -0
  96. data/lib/google/ads/ad_manager/v1/version.rb +1 -1
  97. data/lib/google/ads/ad_manager/v1.rb +7 -0
  98. data/lib/google/ads/admanager/v1/ad_break_service_services_pb.rb +5 -5
  99. data/lib/google/ads/admanager/v1/ad_review_center_ad_service_services_pb.rb +3 -3
  100. data/lib/google/ads/admanager/v1/ad_rule_enums_pb.rb +24 -0
  101. data/lib/google/ads/admanager/v1/ad_rule_messages_pb.rb +32 -0
  102. data/lib/google/ads/admanager/v1/ad_rule_service_pb.rb +42 -0
  103. data/lib/google/ads/admanager/v1/ad_rule_service_services_pb.rb +61 -0
  104. data/lib/google/ads/admanager/v1/ad_rule_slot_behavior_enum_pb.rb +22 -0
  105. data/lib/google/ads/admanager/v1/ad_rule_slot_bumper_enum_pb.rb +22 -0
  106. data/lib/google/ads/admanager/v1/ad_rule_slot_midroll_frequency_type_enum_pb.rb +22 -0
  107. data/lib/google/ads/admanager/v1/ad_spot_messages_pb.rb +27 -0
  108. data/lib/google/ads/admanager/v1/ad_spot_service_pb.rb +36 -0
  109. data/lib/google/ads/admanager/v1/ad_spot_service_services_pb.rb +55 -0
  110. data/lib/google/ads/admanager/v1/ad_spot_targeting_type_enum_pb.rb +22 -0
  111. data/lib/google/ads/admanager/v1/ad_unit_service_services_pb.rb +8 -8
  112. data/lib/google/ads/admanager/v1/admanager_error_pb.rb +23 -0
  113. data/lib/google/ads/admanager/v1/application_service_services_pb.rb +8 -8
  114. data/lib/google/ads/admanager/v1/bandwidth_group_service_services_pb.rb +2 -2
  115. data/lib/google/ads/admanager/v1/browser_language_service_services_pb.rb +2 -2
  116. data/lib/google/ads/admanager/v1/browser_service_services_pb.rb +2 -2
  117. data/lib/google/ads/admanager/v1/cdn_config_messages_pb.rb +33 -0
  118. data/lib/google/ads/admanager/v1/cdn_config_service_pb.rb +40 -0
  119. data/lib/google/ads/admanager/v1/cdn_config_service_services_pb.rb +59 -0
  120. data/lib/google/ads/admanager/v1/cdn_config_status_enum_pb.rb +22 -0
  121. data/lib/google/ads/admanager/v1/cdn_config_type_enum_pb.rb +22 -0
  122. data/lib/google/ads/admanager/v1/cdn_security_policy_enum_pb.rb +22 -0
  123. data/lib/google/ads/admanager/v1/cdn_security_policy_origin_forwarding_enum_pb.rb +22 -0
  124. data/lib/google/ads/admanager/v1/cms_metadata_key_service_services_pb.rb +4 -4
  125. data/lib/google/ads/admanager/v1/cms_metadata_value_service_services_pb.rb +4 -4
  126. data/lib/google/ads/admanager/v1/content_bundle_enums_pb.rb +22 -0
  127. data/lib/google/ads/admanager/v1/content_bundle_messages_pb.rb +3 -1
  128. data/lib/google/ads/admanager/v1/content_bundle_service_services_pb.rb +2 -2
  129. data/lib/google/ads/admanager/v1/content_enums_pb.rb +28 -0
  130. data/lib/google/ads/admanager/v1/content_label_service_services_pb.rb +2 -2
  131. data/lib/google/ads/admanager/v1/content_messages_pb.rb +6 -1
  132. data/lib/google/ads/admanager/v1/content_service_services_pb.rb +2 -2
  133. data/lib/google/ads/admanager/v1/creative_template_service_services_pb.rb +2 -2
  134. data/lib/google/ads/admanager/v1/custom_field_service_services_pb.rb +6 -6
  135. data/lib/google/ads/admanager/v1/custom_targeting_key_service_services_pb.rb +7 -7
  136. data/lib/google/ads/admanager/v1/custom_targeting_value_service_pb.rb +14 -1
  137. data/lib/google/ads/admanager/v1/custom_targeting_value_service_services_pb.rb +14 -2
  138. data/lib/google/ads/admanager/v1/deal_priority_tier_enum_pb.rb +22 -0
  139. data/lib/google/ads/admanager/v1/device_capability_service_services_pb.rb +2 -2
  140. data/lib/google/ads/admanager/v1/device_category_service_services_pb.rb +2 -2
  141. data/lib/google/ads/admanager/v1/device_manufacturer_service_services_pb.rb +2 -2
  142. data/lib/google/ads/admanager/v1/geo_target_service_services_pb.rb +2 -2
  143. data/lib/google/ads/admanager/v1/label_service_services_pb.rb +8 -8
  144. data/lib/google/ads/admanager/v1/line_item_service_services_pb.rb +2 -2
  145. data/lib/google/ads/admanager/v1/live_stream_event_enums_pb.rb +34 -0
  146. data/lib/google/ads/admanager/v1/live_stream_messages_pb.rb +34 -0
  147. data/lib/google/ads/admanager/v1/live_stream_service_pb.rb +46 -0
  148. data/lib/google/ads/admanager/v1/live_stream_service_services_pb.rb +65 -0
  149. data/lib/google/ads/admanager/v1/mobile_carrier_service_services_pb.rb +2 -2
  150. data/lib/google/ads/admanager/v1/mobile_device_service_services_pb.rb +2 -2
  151. data/lib/google/ads/admanager/v1/mobile_device_submodel_service_services_pb.rb +2 -2
  152. data/lib/google/ads/admanager/v1/non_guaranteed_deal_priority_pb.rb +24 -0
  153. data/lib/google/ads/admanager/v1/operating_system_service_services_pb.rb +2 -2
  154. data/lib/google/ads/admanager/v1/operating_system_version_service_services_pb.rb +2 -2
  155. data/lib/google/ads/admanager/v1/order_service_services_pb.rb +2 -2
  156. data/lib/google/ads/admanager/v1/placement_service_services_pb.rb +6 -6
  157. data/lib/google/ads/admanager/v1/private_auction_deal_messages_pb.rb +2 -1
  158. data/lib/google/ads/admanager/v1/private_auction_deal_service_services_pb.rb +4 -4
  159. data/lib/google/ads/admanager/v1/private_auction_service_services_pb.rb +4 -4
  160. data/lib/google/ads/admanager/v1/programmatic_buyer_service_services_pb.rb +2 -2
  161. data/lib/google/ads/admanager/v1/report_definition_pb.rb +1 -1
  162. data/lib/google/ads/admanager/v1/rich_media_ads_company_service_services_pb.rb +2 -2
  163. data/lib/google/ads/admanager/v1/suggested_ad_unit_messages_pb.rb +27 -0
  164. data/lib/google/ads/admanager/v1/suggested_ad_unit_service_pb.rb +31 -0
  165. data/lib/google/ads/admanager/v1/suggested_ad_unit_service_services_pb.rb +49 -0
  166. data/lib/google/ads/admanager/v1/target_platform_enum_pb.rb +22 -0
  167. data/lib/google/ads/admanager/v1/targeting_pb.rb +2 -1
  168. data/lib/google/ads/admanager/v1/targeting_preset_enums_pb.rb +22 -0
  169. data/lib/google/ads/admanager/v1/targeting_preset_messages_pb.rb +26 -0
  170. data/lib/google/ads/admanager/v1/targeting_preset_service_pb.rb +35 -0
  171. data/lib/google/ads/admanager/v1/targeting_preset_service_services_pb.rb +56 -0
  172. data/lib/google/ads/admanager/v1/third_party_company_enums_pb.rb +24 -0
  173. data/lib/google/ads/admanager/v1/third_party_company_messages_pb.rb +25 -0
  174. data/lib/google/ads/admanager/v1/third_party_company_service_pb.rb +29 -0
  175. data/lib/google/ads/admanager/v1/third_party_company_service_services_pb.rb +48 -0
  176. data/proto_docs/google/ads/admanager/v1/ad_rule_enums.rb +68 -0
  177. data/proto_docs/google/ads/admanager/v1/ad_rule_messages.rb +144 -0
  178. data/proto_docs/google/ads/admanager/v1/ad_rule_service.rb +238 -0
  179. data/proto_docs/google/ads/admanager/v1/ad_rule_slot_behavior_enum.rb +49 -0
  180. data/proto_docs/google/ads/admanager/v1/ad_rule_slot_bumper_enum.rb +51 -0
  181. data/proto_docs/google/ads/admanager/v1/ad_rule_slot_midroll_frequency_type_enum.rb +66 -0
  182. data/proto_docs/google/ads/admanager/v1/ad_spot_messages.rb +96 -0
  183. data/proto_docs/google/ads/admanager/v1/ad_spot_service.rb +185 -0
  184. data/proto_docs/google/ads/admanager/v1/ad_spot_targeting_type_enum.rb +51 -0
  185. data/proto_docs/google/ads/admanager/v1/admanager_error.rb +54 -0
  186. data/proto_docs/google/ads/admanager/v1/cdn_config_messages.rb +191 -0
  187. data/proto_docs/google/ads/admanager/v1/cdn_config_service.rb +224 -0
  188. data/proto_docs/google/ads/admanager/v1/cdn_config_status_enum.rb +45 -0
  189. data/proto_docs/google/ads/admanager/v1/cdn_config_type_enum.rb +55 -0
  190. data/proto_docs/google/ads/admanager/v1/cdn_security_policy_enum.rb +50 -0
  191. data/proto_docs/google/ads/admanager/v1/cdn_security_policy_origin_forwarding_enum.rb +50 -0
  192. data/proto_docs/google/ads/admanager/v1/content_bundle_enums.rb +48 -0
  193. data/proto_docs/google/ads/admanager/v1/content_bundle_messages.rb +8 -0
  194. data/proto_docs/google/ads/admanager/v1/content_bundle_service.rb +2 -0
  195. data/proto_docs/google/ads/admanager/v1/content_enums.rb +389 -0
  196. data/proto_docs/google/ads/admanager/v1/content_messages.rb +104 -0
  197. data/proto_docs/google/ads/admanager/v1/content_service.rb +13 -0
  198. data/proto_docs/google/ads/admanager/v1/custom_targeting_value_service.rb +140 -0
  199. data/proto_docs/google/ads/admanager/v1/deal_priority_tier_enum.rb +69 -0
  200. data/proto_docs/google/ads/admanager/v1/live_stream_event_enums.rb +217 -0
  201. data/proto_docs/google/ads/admanager/v1/live_stream_messages.rb +309 -0
  202. data/proto_docs/google/ads/admanager/v1/live_stream_service.rb +288 -0
  203. data/proto_docs/google/ads/admanager/v1/non_guaranteed_deal_priority.rb +37 -0
  204. data/proto_docs/google/ads/admanager/v1/private_auction_deal_messages.rb +3 -0
  205. data/proto_docs/google/ads/admanager/v1/report_definition.rb +22 -7
  206. data/proto_docs/google/ads/admanager/v1/suggested_ad_unit_messages.rb +75 -0
  207. data/proto_docs/google/ads/admanager/v1/suggested_ad_unit_service.rb +130 -0
  208. data/proto_docs/google/ads/admanager/v1/target_platform_enum.rb +48 -0
  209. data/proto_docs/google/ads/admanager/v1/targeting.rb +53 -0
  210. data/proto_docs/google/ads/admanager/v1/targeting_preset_enums.rb +45 -0
  211. data/proto_docs/google/ads/admanager/v1/targeting_preset_messages.rb +47 -0
  212. data/proto_docs/google/ads/admanager/v1/targeting_preset_service.rb +179 -0
  213. data/proto_docs/google/ads/admanager/v1/third_party_company_enums.rb +67 -0
  214. data/proto_docs/google/ads/admanager/v1/third_party_company_messages.rb +49 -0
  215. data/proto_docs/google/ads/admanager/v1/third_party_company_service.rb +108 -0
  216. metadata +116 -3
@@ -0,0 +1,1174 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/ads/admanager/v1/ad_rule_service_pb"
21
+ require "google/ads/ad_manager/v1/ad_rule_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Ads
25
+ module AdManager
26
+ module V1
27
+ module AdRuleService
28
+ module Rest
29
+ ##
30
+ # REST client for the AdRuleService service.
31
+ #
32
+ # Provides methods for handling `AdRule` objects.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "admanager.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :ad_rule_service_stub
45
+
46
+ ##
47
+ # Configure the AdRuleService Client class.
48
+ #
49
+ # See {::Google::Ads::AdManager::V1::AdRuleService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all AdRuleService clients
55
+ # ::Google::Ads::AdManager::V1::AdRuleService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Ads", "AdManager", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the AdRuleService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Ads::AdManager::V1::AdRuleService::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @ad_rule_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new AdRuleService REST client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the AdRuleService client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # Create the configuration object
128
+ @config = Configuration.new Client.configure
129
+
130
+ # Yield the configuration if needed
131
+ yield @config if block_given?
132
+
133
+ # Create credentials
134
+ credentials = @config.credentials
135
+ # Use self-signed JWT if the endpoint is unchanged from default,
136
+ # but only if the default endpoint does not have a region prefix.
137
+ enable_self_signed_jwt = @config.endpoint.nil? ||
138
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
139
+ !@config.endpoint.split(".").first.include?("-"))
140
+ credentials ||= Credentials.default scope: @config.scope,
141
+ enable_self_signed_jwt: enable_self_signed_jwt
142
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
143
+ credentials = Credentials.new credentials, scope: @config.scope
144
+ end
145
+
146
+ @quota_project_id = @config.quota_project
147
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
148
+
149
+ @ad_rule_service_stub = ::Google::Ads::AdManager::V1::AdRuleService::Rest::ServiceStub.new(
150
+ endpoint: @config.endpoint,
151
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
+ universe_domain: @config.universe_domain,
153
+ credentials: credentials,
154
+ logger: @config.logger
155
+ )
156
+
157
+ @ad_rule_service_stub.logger(stub: true)&.info do |entry|
158
+ entry.set_system_name
159
+ entry.set_service
160
+ entry.message = "Created client for #{entry.service}"
161
+ entry.set_credentials_fields credentials
162
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
163
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
164
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
165
+ end
166
+ end
167
+
168
+ ##
169
+ # The logger used for request/response debug logging.
170
+ #
171
+ # @return [Logger]
172
+ #
173
+ def logger
174
+ @ad_rule_service_stub.logger
175
+ end
176
+
177
+ # Service calls
178
+
179
+ ##
180
+ # Retrieves an `AdRule` object.
181
+ #
182
+ # @overload get_ad_rule(request, options = nil)
183
+ # Pass arguments to `get_ad_rule` via a request object, either of type
184
+ # {::Google::Ads::AdManager::V1::GetAdRuleRequest} or an equivalent Hash.
185
+ #
186
+ # @param request [::Google::Ads::AdManager::V1::GetAdRuleRequest, ::Hash]
187
+ # A request object representing the call parameters. Required. To specify no
188
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
189
+ # @param options [::Gapic::CallOptions, ::Hash]
190
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
191
+ #
192
+ # @overload get_ad_rule(name: nil)
193
+ # Pass arguments to `get_ad_rule` via keyword arguments. Note that at
194
+ # least one keyword argument is required. To specify no parameters, or to keep all
195
+ # the default parameter values, pass an empty Hash as a request object (see above).
196
+ #
197
+ # @param name [::String]
198
+ # Required. The resource name of the AdRule.
199
+ # Format: `networks/{network_code}/adRules/{ad_rule_id}`
200
+ # @yield [result, operation] Access the result along with the TransportOperation object
201
+ # @yieldparam result [::Google::Ads::AdManager::V1::AdRule]
202
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
203
+ #
204
+ # @return [::Google::Ads::AdManager::V1::AdRule]
205
+ #
206
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
207
+ #
208
+ # @example Basic example
209
+ # require "google/ads/ad_manager/v1"
210
+ #
211
+ # # Create a client object. The client can be reused for multiple calls.
212
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
213
+ #
214
+ # # Create a request. To set request fields, pass in keyword arguments.
215
+ # request = Google::Ads::AdManager::V1::GetAdRuleRequest.new
216
+ #
217
+ # # Call the get_ad_rule method.
218
+ # result = client.get_ad_rule request
219
+ #
220
+ # # The returned object is of type Google::Ads::AdManager::V1::AdRule.
221
+ # p result
222
+ #
223
+ def get_ad_rule request, options = nil
224
+ raise ::ArgumentError, "request must be provided" if request.nil?
225
+
226
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::GetAdRuleRequest
227
+
228
+ # Converts hash and nil to an options object
229
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
230
+
231
+ # Customize the options with defaults
232
+ call_metadata = @config.rpcs.get_ad_rule.metadata.to_h
233
+
234
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
235
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
236
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
237
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
238
+ transports_version_send: [:rest]
239
+
240
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
241
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
242
+
243
+ options.apply_defaults timeout: @config.rpcs.get_ad_rule.timeout,
244
+ metadata: call_metadata,
245
+ retry_policy: @config.rpcs.get_ad_rule.retry_policy
246
+
247
+ options.apply_defaults timeout: @config.timeout,
248
+ metadata: @config.metadata,
249
+ retry_policy: @config.retry_policy
250
+
251
+ @ad_rule_service_stub.get_ad_rule request, options do |result, operation|
252
+ yield result, operation if block_given?
253
+ end
254
+ rescue ::Gapic::Rest::Error => e
255
+ raise ::Google::Cloud::Error.from_error(e)
256
+ end
257
+
258
+ ##
259
+ # Lists `AdRule` objects.
260
+ #
261
+ # @overload list_ad_rules(request, options = nil)
262
+ # Pass arguments to `list_ad_rules` via a request object, either of type
263
+ # {::Google::Ads::AdManager::V1::ListAdRulesRequest} or an equivalent Hash.
264
+ #
265
+ # @param request [::Google::Ads::AdManager::V1::ListAdRulesRequest, ::Hash]
266
+ # A request object representing the call parameters. Required. To specify no
267
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
268
+ # @param options [::Gapic::CallOptions, ::Hash]
269
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
270
+ #
271
+ # @overload list_ad_rules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, skip: nil)
272
+ # Pass arguments to `list_ad_rules` via keyword arguments. Note that at
273
+ # least one keyword argument is required. To specify no parameters, or to keep all
274
+ # the default parameter values, pass an empty Hash as a request object (see above).
275
+ #
276
+ # @param parent [::String]
277
+ # Required. The parent, which owns this collection of AdRules.
278
+ # Format: `networks/{network_code}`
279
+ # @param page_size [::Integer]
280
+ # Optional. The maximum number of `AdRules` to return. The service may return
281
+ # fewer than this value. If unspecified, at most 50 `AdRules` will be
282
+ # returned. The maximum value is 1000; values greater than 1000 will be
283
+ # coerced to 1000.
284
+ # @param page_token [::String]
285
+ # Optional. A page token, received from a previous `ListAdRules` call.
286
+ # Provide this to retrieve the subsequent page.
287
+ #
288
+ # When paginating, all other parameters provided to `ListAdRules` must match
289
+ # the call that provided the page token.
290
+ # @param filter [::String]
291
+ # Optional. Expression to filter the response.
292
+ # See syntax details at
293
+ # https://developers.google.com/ad-manager/api/beta/filters
294
+ #
295
+ # <b>Filterable fields:</b>
296
+ # <ul style="list-style-type:none">
297
+ # <li><code>displayName</code></li>
298
+ # <li><code>name</code></li>
299
+ # <li><code>priority</code></li>
300
+ # <li><code>status</code></li>
301
+ # </ul>
302
+ # @param order_by [::String]
303
+ # Optional. Expression to specify sorting order.
304
+ # See syntax details at
305
+ # https://developers.google.com/ad-manager/api/beta/filters#order
306
+ # @param skip [::Integer]
307
+ # Optional. Number of individual resources to skip while paginating.
308
+ # @yield [result, operation] Access the result along with the TransportOperation object
309
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::AdRule>]
310
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
311
+ #
312
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::AdRule>]
313
+ #
314
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
315
+ #
316
+ # @example Basic example
317
+ # require "google/ads/ad_manager/v1"
318
+ #
319
+ # # Create a client object. The client can be reused for multiple calls.
320
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
321
+ #
322
+ # # Create a request. To set request fields, pass in keyword arguments.
323
+ # request = Google::Ads::AdManager::V1::ListAdRulesRequest.new
324
+ #
325
+ # # Call the list_ad_rules method.
326
+ # result = client.list_ad_rules request
327
+ #
328
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
329
+ # # over elements, and API calls will be issued to fetch pages as needed.
330
+ # result.each do |item|
331
+ # # Each element is of type ::Google::Ads::AdManager::V1::AdRule.
332
+ # p item
333
+ # end
334
+ #
335
+ def list_ad_rules request, options = nil
336
+ raise ::ArgumentError, "request must be provided" if request.nil?
337
+
338
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::ListAdRulesRequest
339
+
340
+ # Converts hash and nil to an options object
341
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
342
+
343
+ # Customize the options with defaults
344
+ call_metadata = @config.rpcs.list_ad_rules.metadata.to_h
345
+
346
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
347
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
348
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
349
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
350
+ transports_version_send: [:rest]
351
+
352
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
353
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
354
+
355
+ options.apply_defaults timeout: @config.rpcs.list_ad_rules.timeout,
356
+ metadata: call_metadata,
357
+ retry_policy: @config.rpcs.list_ad_rules.retry_policy
358
+
359
+ options.apply_defaults timeout: @config.timeout,
360
+ metadata: @config.metadata,
361
+ retry_policy: @config.retry_policy
362
+
363
+ @ad_rule_service_stub.list_ad_rules request, options do |result, operation|
364
+ result = ::Gapic::Rest::PagedEnumerable.new @ad_rule_service_stub, :list_ad_rules, "ad_rules", request, result, options
365
+ yield result, operation if block_given?
366
+ throw :response, result
367
+ end
368
+ rescue ::Gapic::Rest::Error => e
369
+ raise ::Google::Cloud::Error.from_error(e)
370
+ end
371
+
372
+ ##
373
+ # Creates a `AdRule` object.
374
+ #
375
+ # @overload create_ad_rule(request, options = nil)
376
+ # Pass arguments to `create_ad_rule` via a request object, either of type
377
+ # {::Google::Ads::AdManager::V1::CreateAdRuleRequest} or an equivalent Hash.
378
+ #
379
+ # @param request [::Google::Ads::AdManager::V1::CreateAdRuleRequest, ::Hash]
380
+ # A request object representing the call parameters. Required. To specify no
381
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
382
+ # @param options [::Gapic::CallOptions, ::Hash]
383
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
384
+ #
385
+ # @overload create_ad_rule(parent: nil, ad_rule: nil)
386
+ # Pass arguments to `create_ad_rule` via keyword arguments. Note that at
387
+ # least one keyword argument is required. To specify no parameters, or to keep all
388
+ # the default parameter values, pass an empty Hash as a request object (see above).
389
+ #
390
+ # @param parent [::String]
391
+ # Required. The parent resource where this `AdRule` will be created.
392
+ # Format: `networks/{network_code}`
393
+ # @param ad_rule [::Google::Ads::AdManager::V1::AdRule, ::Hash]
394
+ # Required. The `AdRule` to create.
395
+ # @yield [result, operation] Access the result along with the TransportOperation object
396
+ # @yieldparam result [::Google::Ads::AdManager::V1::AdRule]
397
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
398
+ #
399
+ # @return [::Google::Ads::AdManager::V1::AdRule]
400
+ #
401
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
402
+ #
403
+ # @example Basic example
404
+ # require "google/ads/ad_manager/v1"
405
+ #
406
+ # # Create a client object. The client can be reused for multiple calls.
407
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
408
+ #
409
+ # # Create a request. To set request fields, pass in keyword arguments.
410
+ # request = Google::Ads::AdManager::V1::CreateAdRuleRequest.new
411
+ #
412
+ # # Call the create_ad_rule method.
413
+ # result = client.create_ad_rule request
414
+ #
415
+ # # The returned object is of type Google::Ads::AdManager::V1::AdRule.
416
+ # p result
417
+ #
418
+ def create_ad_rule request, options = nil
419
+ raise ::ArgumentError, "request must be provided" if request.nil?
420
+
421
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::CreateAdRuleRequest
422
+
423
+ # Converts hash and nil to an options object
424
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
425
+
426
+ # Customize the options with defaults
427
+ call_metadata = @config.rpcs.create_ad_rule.metadata.to_h
428
+
429
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
430
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
432
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
433
+ transports_version_send: [:rest]
434
+
435
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
436
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
437
+
438
+ options.apply_defaults timeout: @config.rpcs.create_ad_rule.timeout,
439
+ metadata: call_metadata,
440
+ retry_policy: @config.rpcs.create_ad_rule.retry_policy
441
+
442
+ options.apply_defaults timeout: @config.timeout,
443
+ metadata: @config.metadata,
444
+ retry_policy: @config.retry_policy
445
+
446
+ @ad_rule_service_stub.create_ad_rule request, options do |result, operation|
447
+ yield result, operation if block_given?
448
+ end
449
+ rescue ::Gapic::Rest::Error => e
450
+ raise ::Google::Cloud::Error.from_error(e)
451
+ end
452
+
453
+ ##
454
+ # Batch creates `AdRule` objects.
455
+ #
456
+ # @overload batch_create_ad_rules(request, options = nil)
457
+ # Pass arguments to `batch_create_ad_rules` via a request object, either of type
458
+ # {::Google::Ads::AdManager::V1::BatchCreateAdRulesRequest} or an equivalent Hash.
459
+ #
460
+ # @param request [::Google::Ads::AdManager::V1::BatchCreateAdRulesRequest, ::Hash]
461
+ # A request object representing the call parameters. Required. To specify no
462
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
463
+ # @param options [::Gapic::CallOptions, ::Hash]
464
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
465
+ #
466
+ # @overload batch_create_ad_rules(parent: nil, requests: nil)
467
+ # Pass arguments to `batch_create_ad_rules` via keyword arguments. Note that at
468
+ # least one keyword argument is required. To specify no parameters, or to keep all
469
+ # the default parameter values, pass an empty Hash as a request object (see above).
470
+ #
471
+ # @param parent [::String]
472
+ # Required. The parent resource where `AdRules` will be created.
473
+ # Format: `networks/{network_code}`
474
+ # The parent field in the CreateAdRuleRequest must match this
475
+ # field.
476
+ # @param requests [::Array<::Google::Ads::AdManager::V1::CreateAdRuleRequest, ::Hash>]
477
+ # Required. The `AdRule` objects to create.
478
+ # A maximum of 100 objects can be created in a batch.
479
+ # @yield [result, operation] Access the result along with the TransportOperation object
480
+ # @yieldparam result [::Google::Ads::AdManager::V1::BatchCreateAdRulesResponse]
481
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
482
+ #
483
+ # @return [::Google::Ads::AdManager::V1::BatchCreateAdRulesResponse]
484
+ #
485
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
486
+ #
487
+ # @example Basic example
488
+ # require "google/ads/ad_manager/v1"
489
+ #
490
+ # # Create a client object. The client can be reused for multiple calls.
491
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
492
+ #
493
+ # # Create a request. To set request fields, pass in keyword arguments.
494
+ # request = Google::Ads::AdManager::V1::BatchCreateAdRulesRequest.new
495
+ #
496
+ # # Call the batch_create_ad_rules method.
497
+ # result = client.batch_create_ad_rules request
498
+ #
499
+ # # The returned object is of type Google::Ads::AdManager::V1::BatchCreateAdRulesResponse.
500
+ # p result
501
+ #
502
+ def batch_create_ad_rules request, options = nil
503
+ raise ::ArgumentError, "request must be provided" if request.nil?
504
+
505
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchCreateAdRulesRequest
506
+
507
+ # Converts hash and nil to an options object
508
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
509
+
510
+ # Customize the options with defaults
511
+ call_metadata = @config.rpcs.batch_create_ad_rules.metadata.to_h
512
+
513
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
514
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
515
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
516
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
517
+ transports_version_send: [:rest]
518
+
519
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
520
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
521
+
522
+ options.apply_defaults timeout: @config.rpcs.batch_create_ad_rules.timeout,
523
+ metadata: call_metadata,
524
+ retry_policy: @config.rpcs.batch_create_ad_rules.retry_policy
525
+
526
+ options.apply_defaults timeout: @config.timeout,
527
+ metadata: @config.metadata,
528
+ retry_policy: @config.retry_policy
529
+
530
+ @ad_rule_service_stub.batch_create_ad_rules request, options do |result, operation|
531
+ yield result, operation if block_given?
532
+ end
533
+ rescue ::Gapic::Rest::Error => e
534
+ raise ::Google::Cloud::Error.from_error(e)
535
+ end
536
+
537
+ ##
538
+ # Updates a `AdRule` object.
539
+ #
540
+ # @overload update_ad_rule(request, options = nil)
541
+ # Pass arguments to `update_ad_rule` via a request object, either of type
542
+ # {::Google::Ads::AdManager::V1::UpdateAdRuleRequest} or an equivalent Hash.
543
+ #
544
+ # @param request [::Google::Ads::AdManager::V1::UpdateAdRuleRequest, ::Hash]
545
+ # A request object representing the call parameters. Required. To specify no
546
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
547
+ # @param options [::Gapic::CallOptions, ::Hash]
548
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
549
+ #
550
+ # @overload update_ad_rule(ad_rule: nil, update_mask: nil)
551
+ # Pass arguments to `update_ad_rule` via keyword arguments. Note that at
552
+ # least one keyword argument is required. To specify no parameters, or to keep all
553
+ # the default parameter values, pass an empty Hash as a request object (see above).
554
+ #
555
+ # @param ad_rule [::Google::Ads::AdManager::V1::AdRule, ::Hash]
556
+ # Required. The `AdRule` to update.
557
+ #
558
+ # The `AdRule`'s `name` is used to identify the `AdRule` to update.
559
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
560
+ # Optional. The list of fields to update.
561
+ # @yield [result, operation] Access the result along with the TransportOperation object
562
+ # @yieldparam result [::Google::Ads::AdManager::V1::AdRule]
563
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
564
+ #
565
+ # @return [::Google::Ads::AdManager::V1::AdRule]
566
+ #
567
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
568
+ #
569
+ # @example Basic example
570
+ # require "google/ads/ad_manager/v1"
571
+ #
572
+ # # Create a client object. The client can be reused for multiple calls.
573
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
574
+ #
575
+ # # Create a request. To set request fields, pass in keyword arguments.
576
+ # request = Google::Ads::AdManager::V1::UpdateAdRuleRequest.new
577
+ #
578
+ # # Call the update_ad_rule method.
579
+ # result = client.update_ad_rule request
580
+ #
581
+ # # The returned object is of type Google::Ads::AdManager::V1::AdRule.
582
+ # p result
583
+ #
584
+ def update_ad_rule request, options = nil
585
+ raise ::ArgumentError, "request must be provided" if request.nil?
586
+
587
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::UpdateAdRuleRequest
588
+
589
+ # Converts hash and nil to an options object
590
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
591
+
592
+ # Customize the options with defaults
593
+ call_metadata = @config.rpcs.update_ad_rule.metadata.to_h
594
+
595
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
596
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
597
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
598
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
599
+ transports_version_send: [:rest]
600
+
601
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
602
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
603
+
604
+ options.apply_defaults timeout: @config.rpcs.update_ad_rule.timeout,
605
+ metadata: call_metadata,
606
+ retry_policy: @config.rpcs.update_ad_rule.retry_policy
607
+
608
+ options.apply_defaults timeout: @config.timeout,
609
+ metadata: @config.metadata,
610
+ retry_policy: @config.retry_policy
611
+
612
+ @ad_rule_service_stub.update_ad_rule request, options do |result, operation|
613
+ yield result, operation if block_given?
614
+ end
615
+ rescue ::Gapic::Rest::Error => e
616
+ raise ::Google::Cloud::Error.from_error(e)
617
+ end
618
+
619
+ ##
620
+ # Batch updates `AdRule` objects.
621
+ #
622
+ # @overload batch_update_ad_rules(request, options = nil)
623
+ # Pass arguments to `batch_update_ad_rules` via a request object, either of type
624
+ # {::Google::Ads::AdManager::V1::BatchUpdateAdRulesRequest} or an equivalent Hash.
625
+ #
626
+ # @param request [::Google::Ads::AdManager::V1::BatchUpdateAdRulesRequest, ::Hash]
627
+ # A request object representing the call parameters. Required. To specify no
628
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
629
+ # @param options [::Gapic::CallOptions, ::Hash]
630
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
631
+ #
632
+ # @overload batch_update_ad_rules(parent: nil, requests: nil)
633
+ # Pass arguments to `batch_update_ad_rules` via keyword arguments. Note that at
634
+ # least one keyword argument is required. To specify no parameters, or to keep all
635
+ # the default parameter values, pass an empty Hash as a request object (see above).
636
+ #
637
+ # @param parent [::String]
638
+ # Required. The parent resource where `AdRules` will be updated.
639
+ # Format: `networks/{network_code}`
640
+ # The parent field in the UpdateAdRuleRequest must match this
641
+ # field.
642
+ # @param requests [::Array<::Google::Ads::AdManager::V1::UpdateAdRuleRequest, ::Hash>]
643
+ # Required. The `AdRule` objects to update.
644
+ # A maximum of 100 objects can be updated in a batch.
645
+ # @yield [result, operation] Access the result along with the TransportOperation object
646
+ # @yieldparam result [::Google::Ads::AdManager::V1::BatchUpdateAdRulesResponse]
647
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
648
+ #
649
+ # @return [::Google::Ads::AdManager::V1::BatchUpdateAdRulesResponse]
650
+ #
651
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
652
+ #
653
+ # @example Basic example
654
+ # require "google/ads/ad_manager/v1"
655
+ #
656
+ # # Create a client object. The client can be reused for multiple calls.
657
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
658
+ #
659
+ # # Create a request. To set request fields, pass in keyword arguments.
660
+ # request = Google::Ads::AdManager::V1::BatchUpdateAdRulesRequest.new
661
+ #
662
+ # # Call the batch_update_ad_rules method.
663
+ # result = client.batch_update_ad_rules request
664
+ #
665
+ # # The returned object is of type Google::Ads::AdManager::V1::BatchUpdateAdRulesResponse.
666
+ # p result
667
+ #
668
+ def batch_update_ad_rules request, options = nil
669
+ raise ::ArgumentError, "request must be provided" if request.nil?
670
+
671
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchUpdateAdRulesRequest
672
+
673
+ # Converts hash and nil to an options object
674
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
675
+
676
+ # Customize the options with defaults
677
+ call_metadata = @config.rpcs.batch_update_ad_rules.metadata.to_h
678
+
679
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
680
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
681
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
682
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
683
+ transports_version_send: [:rest]
684
+
685
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
686
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
687
+
688
+ options.apply_defaults timeout: @config.rpcs.batch_update_ad_rules.timeout,
689
+ metadata: call_metadata,
690
+ retry_policy: @config.rpcs.batch_update_ad_rules.retry_policy
691
+
692
+ options.apply_defaults timeout: @config.timeout,
693
+ metadata: @config.metadata,
694
+ retry_policy: @config.retry_policy
695
+
696
+ @ad_rule_service_stub.batch_update_ad_rules request, options do |result, operation|
697
+ yield result, operation if block_given?
698
+ end
699
+ rescue ::Gapic::Rest::Error => e
700
+ raise ::Google::Cloud::Error.from_error(e)
701
+ end
702
+
703
+ ##
704
+ # Activates a list of `AdRule` objects.
705
+ #
706
+ # @overload batch_activate_ad_rules(request, options = nil)
707
+ # Pass arguments to `batch_activate_ad_rules` via a request object, either of type
708
+ # {::Google::Ads::AdManager::V1::BatchActivateAdRulesRequest} or an equivalent Hash.
709
+ #
710
+ # @param request [::Google::Ads::AdManager::V1::BatchActivateAdRulesRequest, ::Hash]
711
+ # A request object representing the call parameters. Required. To specify no
712
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
713
+ # @param options [::Gapic::CallOptions, ::Hash]
714
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
715
+ #
716
+ # @overload batch_activate_ad_rules(parent: nil, names: nil)
717
+ # Pass arguments to `batch_activate_ad_rules` via keyword arguments. Note that at
718
+ # least one keyword argument is required. To specify no parameters, or to keep all
719
+ # the default parameter values, pass an empty Hash as a request object (see above).
720
+ #
721
+ # @param parent [::String]
722
+ # Required. Format: `networks/{network_code}`
723
+ # @param names [::Array<::String>]
724
+ # Required. Resource names for the AdRule.
725
+ # Format:
726
+ # `networks/{network_code}/adRules/{ad_rule}`
727
+ # @yield [result, operation] Access the result along with the TransportOperation object
728
+ # @yieldparam result [::Google::Ads::AdManager::V1::BatchActivateAdRulesResponse]
729
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
730
+ #
731
+ # @return [::Google::Ads::AdManager::V1::BatchActivateAdRulesResponse]
732
+ #
733
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
734
+ #
735
+ # @example Basic example
736
+ # require "google/ads/ad_manager/v1"
737
+ #
738
+ # # Create a client object. The client can be reused for multiple calls.
739
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
740
+ #
741
+ # # Create a request. To set request fields, pass in keyword arguments.
742
+ # request = Google::Ads::AdManager::V1::BatchActivateAdRulesRequest.new
743
+ #
744
+ # # Call the batch_activate_ad_rules method.
745
+ # result = client.batch_activate_ad_rules request
746
+ #
747
+ # # The returned object is of type Google::Ads::AdManager::V1::BatchActivateAdRulesResponse.
748
+ # p result
749
+ #
750
+ def batch_activate_ad_rules request, options = nil
751
+ raise ::ArgumentError, "request must be provided" if request.nil?
752
+
753
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchActivateAdRulesRequest
754
+
755
+ # Converts hash and nil to an options object
756
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
757
+
758
+ # Customize the options with defaults
759
+ call_metadata = @config.rpcs.batch_activate_ad_rules.metadata.to_h
760
+
761
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
762
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
763
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
764
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
765
+ transports_version_send: [:rest]
766
+
767
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
768
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
769
+
770
+ options.apply_defaults timeout: @config.rpcs.batch_activate_ad_rules.timeout,
771
+ metadata: call_metadata,
772
+ retry_policy: @config.rpcs.batch_activate_ad_rules.retry_policy
773
+
774
+ options.apply_defaults timeout: @config.timeout,
775
+ metadata: @config.metadata,
776
+ retry_policy: @config.retry_policy
777
+
778
+ @ad_rule_service_stub.batch_activate_ad_rules request, options do |result, operation|
779
+ yield result, operation if block_given?
780
+ end
781
+ rescue ::Gapic::Rest::Error => e
782
+ raise ::Google::Cloud::Error.from_error(e)
783
+ end
784
+
785
+ ##
786
+ # Deactivates a list of `AdRule` objects.
787
+ #
788
+ # @overload batch_deactivate_ad_rules(request, options = nil)
789
+ # Pass arguments to `batch_deactivate_ad_rules` via a request object, either of type
790
+ # {::Google::Ads::AdManager::V1::BatchDeactivateAdRulesRequest} or an equivalent Hash.
791
+ #
792
+ # @param request [::Google::Ads::AdManager::V1::BatchDeactivateAdRulesRequest, ::Hash]
793
+ # A request object representing the call parameters. Required. To specify no
794
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
795
+ # @param options [::Gapic::CallOptions, ::Hash]
796
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
797
+ #
798
+ # @overload batch_deactivate_ad_rules(parent: nil, names: nil)
799
+ # Pass arguments to `batch_deactivate_ad_rules` via keyword arguments. Note that at
800
+ # least one keyword argument is required. To specify no parameters, or to keep all
801
+ # the default parameter values, pass an empty Hash as a request object (see above).
802
+ #
803
+ # @param parent [::String]
804
+ # Required. Format: `networks/{network_code}`
805
+ # @param names [::Array<::String>]
806
+ # Required. Resource names for the AdRule.
807
+ # Format:
808
+ # `networks/{network_code}/adRules/{ad_rule}`
809
+ # @yield [result, operation] Access the result along with the TransportOperation object
810
+ # @yieldparam result [::Google::Ads::AdManager::V1::BatchDeactivateAdRulesResponse]
811
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
812
+ #
813
+ # @return [::Google::Ads::AdManager::V1::BatchDeactivateAdRulesResponse]
814
+ #
815
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
816
+ #
817
+ # @example Basic example
818
+ # require "google/ads/ad_manager/v1"
819
+ #
820
+ # # Create a client object. The client can be reused for multiple calls.
821
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
822
+ #
823
+ # # Create a request. To set request fields, pass in keyword arguments.
824
+ # request = Google::Ads::AdManager::V1::BatchDeactivateAdRulesRequest.new
825
+ #
826
+ # # Call the batch_deactivate_ad_rules method.
827
+ # result = client.batch_deactivate_ad_rules request
828
+ #
829
+ # # The returned object is of type Google::Ads::AdManager::V1::BatchDeactivateAdRulesResponse.
830
+ # p result
831
+ #
832
+ def batch_deactivate_ad_rules request, options = nil
833
+ raise ::ArgumentError, "request must be provided" if request.nil?
834
+
835
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchDeactivateAdRulesRequest
836
+
837
+ # Converts hash and nil to an options object
838
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
839
+
840
+ # Customize the options with defaults
841
+ call_metadata = @config.rpcs.batch_deactivate_ad_rules.metadata.to_h
842
+
843
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
844
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
845
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
846
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
847
+ transports_version_send: [:rest]
848
+
849
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
850
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
851
+
852
+ options.apply_defaults timeout: @config.rpcs.batch_deactivate_ad_rules.timeout,
853
+ metadata: call_metadata,
854
+ retry_policy: @config.rpcs.batch_deactivate_ad_rules.retry_policy
855
+
856
+ options.apply_defaults timeout: @config.timeout,
857
+ metadata: @config.metadata,
858
+ retry_policy: @config.retry_policy
859
+
860
+ @ad_rule_service_stub.batch_deactivate_ad_rules request, options do |result, operation|
861
+ yield result, operation if block_given?
862
+ end
863
+ rescue ::Gapic::Rest::Error => e
864
+ raise ::Google::Cloud::Error.from_error(e)
865
+ end
866
+
867
+ ##
868
+ # Deletes a list of `AdRule` objects.
869
+ #
870
+ # @overload batch_delete_ad_rules(request, options = nil)
871
+ # Pass arguments to `batch_delete_ad_rules` via a request object, either of type
872
+ # {::Google::Ads::AdManager::V1::BatchDeleteAdRulesRequest} or an equivalent Hash.
873
+ #
874
+ # @param request [::Google::Ads::AdManager::V1::BatchDeleteAdRulesRequest, ::Hash]
875
+ # A request object representing the call parameters. Required. To specify no
876
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
877
+ # @param options [::Gapic::CallOptions, ::Hash]
878
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
879
+ #
880
+ # @overload batch_delete_ad_rules(parent: nil, names: nil)
881
+ # Pass arguments to `batch_delete_ad_rules` via keyword arguments. Note that at
882
+ # least one keyword argument is required. To specify no parameters, or to keep all
883
+ # the default parameter values, pass an empty Hash as a request object (see above).
884
+ #
885
+ # @param parent [::String]
886
+ # Required. Format: `networks/{network_code}`
887
+ # @param names [::Array<::String>]
888
+ # Required. Resource names for the AdRule.
889
+ # Format:
890
+ # `networks/{network_code}/adRules/{ad_rule}`
891
+ # @yield [result, operation] Access the result along with the TransportOperation object
892
+ # @yieldparam result [::Google::Protobuf::Empty]
893
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
894
+ #
895
+ # @return [::Google::Protobuf::Empty]
896
+ #
897
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
898
+ #
899
+ # @example Basic example
900
+ # require "google/ads/ad_manager/v1"
901
+ #
902
+ # # Create a client object. The client can be reused for multiple calls.
903
+ # client = Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new
904
+ #
905
+ # # Create a request. To set request fields, pass in keyword arguments.
906
+ # request = Google::Ads::AdManager::V1::BatchDeleteAdRulesRequest.new
907
+ #
908
+ # # Call the batch_delete_ad_rules method.
909
+ # result = client.batch_delete_ad_rules request
910
+ #
911
+ # # The returned object is of type Google::Protobuf::Empty.
912
+ # p result
913
+ #
914
+ def batch_delete_ad_rules request, options = nil
915
+ raise ::ArgumentError, "request must be provided" if request.nil?
916
+
917
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchDeleteAdRulesRequest
918
+
919
+ # Converts hash and nil to an options object
920
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
921
+
922
+ # Customize the options with defaults
923
+ call_metadata = @config.rpcs.batch_delete_ad_rules.metadata.to_h
924
+
925
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
926
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
927
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
928
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
929
+ transports_version_send: [:rest]
930
+
931
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
932
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
933
+
934
+ options.apply_defaults timeout: @config.rpcs.batch_delete_ad_rules.timeout,
935
+ metadata: call_metadata,
936
+ retry_policy: @config.rpcs.batch_delete_ad_rules.retry_policy
937
+
938
+ options.apply_defaults timeout: @config.timeout,
939
+ metadata: @config.metadata,
940
+ retry_policy: @config.retry_policy
941
+
942
+ @ad_rule_service_stub.batch_delete_ad_rules request, options do |result, operation|
943
+ yield result, operation if block_given?
944
+ end
945
+ rescue ::Gapic::Rest::Error => e
946
+ raise ::Google::Cloud::Error.from_error(e)
947
+ end
948
+
949
+ ##
950
+ # Configuration class for the AdRuleService REST API.
951
+ #
952
+ # This class represents the configuration for AdRuleService REST,
953
+ # providing control over timeouts, retry behavior, logging, transport
954
+ # parameters, and other low-level controls. Certain parameters can also be
955
+ # applied individually to specific RPCs. See
956
+ # {::Google::Ads::AdManager::V1::AdRuleService::Rest::Client::Configuration::Rpcs}
957
+ # for a list of RPCs that can be configured independently.
958
+ #
959
+ # Configuration can be applied globally to all clients, or to a single client
960
+ # on construction.
961
+ #
962
+ # @example
963
+ #
964
+ # # Modify the global config, setting the timeout for
965
+ # # get_ad_rule to 20 seconds,
966
+ # # and all remaining timeouts to 10 seconds.
967
+ # ::Google::Ads::AdManager::V1::AdRuleService::Rest::Client.configure do |config|
968
+ # config.timeout = 10.0
969
+ # config.rpcs.get_ad_rule.timeout = 20.0
970
+ # end
971
+ #
972
+ # # Apply the above configuration only to a new client.
973
+ # client = ::Google::Ads::AdManager::V1::AdRuleService::Rest::Client.new do |config|
974
+ # config.timeout = 10.0
975
+ # config.rpcs.get_ad_rule.timeout = 20.0
976
+ # end
977
+ #
978
+ # @!attribute [rw] endpoint
979
+ # A custom service endpoint, as a hostname or hostname:port. The default is
980
+ # nil, indicating to use the default endpoint in the current universe domain.
981
+ # @return [::String,nil]
982
+ # @!attribute [rw] credentials
983
+ # Credentials to send with calls. You may provide any of the following types:
984
+ # * (`String`) The path to a service account key file in JSON format
985
+ # * (`Hash`) A service account key as a Hash
986
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
987
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
988
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
989
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
990
+ # * (`nil`) indicating no credentials
991
+ #
992
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
993
+ # external source for authentication to Google Cloud, you must validate it before
994
+ # providing it to a Google API client library. Providing an unvalidated credential
995
+ # configuration to Google APIs can compromise the security of your systems and data.
996
+ # For more information, refer to [Validate credential configurations from external
997
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
998
+ # @return [::Object]
999
+ # @!attribute [rw] scope
1000
+ # The OAuth scopes
1001
+ # @return [::Array<::String>]
1002
+ # @!attribute [rw] lib_name
1003
+ # The library name as recorded in instrumentation and logging
1004
+ # @return [::String]
1005
+ # @!attribute [rw] lib_version
1006
+ # The library version as recorded in instrumentation and logging
1007
+ # @return [::String]
1008
+ # @!attribute [rw] timeout
1009
+ # The call timeout in seconds.
1010
+ # @return [::Numeric]
1011
+ # @!attribute [rw] metadata
1012
+ # Additional headers to be sent with the call.
1013
+ # @return [::Hash{::Symbol=>::String}]
1014
+ # @!attribute [rw] retry_policy
1015
+ # The retry policy. The value is a hash with the following keys:
1016
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1017
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1018
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1019
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1020
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1021
+ # trigger a retry.
1022
+ # @return [::Hash]
1023
+ # @!attribute [rw] quota_project
1024
+ # A separate project against which to charge quota.
1025
+ # @return [::String]
1026
+ # @!attribute [rw] universe_domain
1027
+ # The universe domain within which to make requests. This determines the
1028
+ # default endpoint URL. The default value of nil uses the environment
1029
+ # universe (usually the default "googleapis.com" universe).
1030
+ # @return [::String,nil]
1031
+ # @!attribute [rw] logger
1032
+ # A custom logger to use for request/response debug logging, or the value
1033
+ # `:default` (the default) to construct a default logger, or `nil` to
1034
+ # explicitly disable logging.
1035
+ # @return [::Logger,:default,nil]
1036
+ #
1037
+ class Configuration
1038
+ extend ::Gapic::Config
1039
+
1040
+ # @private
1041
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1042
+ DEFAULT_ENDPOINT = "admanager.googleapis.com"
1043
+
1044
+ config_attr :endpoint, nil, ::String, nil
1045
+ config_attr :credentials, nil do |value|
1046
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1047
+ allowed.any? { |klass| klass === value }
1048
+ end
1049
+ config_attr :scope, nil, ::String, ::Array, nil
1050
+ config_attr :lib_name, nil, ::String, nil
1051
+ config_attr :lib_version, nil, ::String, nil
1052
+ config_attr :timeout, nil, ::Numeric, nil
1053
+ config_attr :metadata, nil, ::Hash, nil
1054
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1055
+ config_attr :quota_project, nil, ::String, nil
1056
+ config_attr :universe_domain, nil, ::String, nil
1057
+ config_attr :logger, :default, ::Logger, nil, :default
1058
+
1059
+ # @private
1060
+ def initialize parent_config = nil
1061
+ @parent_config = parent_config unless parent_config.nil?
1062
+
1063
+ yield self if block_given?
1064
+ end
1065
+
1066
+ ##
1067
+ # Configurations for individual RPCs
1068
+ # @return [Rpcs]
1069
+ #
1070
+ def rpcs
1071
+ @rpcs ||= begin
1072
+ parent_rpcs = nil
1073
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1074
+ Rpcs.new parent_rpcs
1075
+ end
1076
+ end
1077
+
1078
+ ##
1079
+ # Configuration RPC class for the AdRuleService API.
1080
+ #
1081
+ # Includes fields providing the configuration for each RPC in this service.
1082
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1083
+ # the following configuration fields:
1084
+ #
1085
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1086
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1087
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1088
+ # include the following keys:
1089
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1090
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1091
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1092
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1093
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1094
+ # trigger a retry.
1095
+ #
1096
+ class Rpcs
1097
+ ##
1098
+ # RPC-specific configuration for `get_ad_rule`
1099
+ # @return [::Gapic::Config::Method]
1100
+ #
1101
+ attr_reader :get_ad_rule
1102
+ ##
1103
+ # RPC-specific configuration for `list_ad_rules`
1104
+ # @return [::Gapic::Config::Method]
1105
+ #
1106
+ attr_reader :list_ad_rules
1107
+ ##
1108
+ # RPC-specific configuration for `create_ad_rule`
1109
+ # @return [::Gapic::Config::Method]
1110
+ #
1111
+ attr_reader :create_ad_rule
1112
+ ##
1113
+ # RPC-specific configuration for `batch_create_ad_rules`
1114
+ # @return [::Gapic::Config::Method]
1115
+ #
1116
+ attr_reader :batch_create_ad_rules
1117
+ ##
1118
+ # RPC-specific configuration for `update_ad_rule`
1119
+ # @return [::Gapic::Config::Method]
1120
+ #
1121
+ attr_reader :update_ad_rule
1122
+ ##
1123
+ # RPC-specific configuration for `batch_update_ad_rules`
1124
+ # @return [::Gapic::Config::Method]
1125
+ #
1126
+ attr_reader :batch_update_ad_rules
1127
+ ##
1128
+ # RPC-specific configuration for `batch_activate_ad_rules`
1129
+ # @return [::Gapic::Config::Method]
1130
+ #
1131
+ attr_reader :batch_activate_ad_rules
1132
+ ##
1133
+ # RPC-specific configuration for `batch_deactivate_ad_rules`
1134
+ # @return [::Gapic::Config::Method]
1135
+ #
1136
+ attr_reader :batch_deactivate_ad_rules
1137
+ ##
1138
+ # RPC-specific configuration for `batch_delete_ad_rules`
1139
+ # @return [::Gapic::Config::Method]
1140
+ #
1141
+ attr_reader :batch_delete_ad_rules
1142
+
1143
+ # @private
1144
+ def initialize parent_rpcs = nil
1145
+ get_ad_rule_config = parent_rpcs.get_ad_rule if parent_rpcs.respond_to? :get_ad_rule
1146
+ @get_ad_rule = ::Gapic::Config::Method.new get_ad_rule_config
1147
+ list_ad_rules_config = parent_rpcs.list_ad_rules if parent_rpcs.respond_to? :list_ad_rules
1148
+ @list_ad_rules = ::Gapic::Config::Method.new list_ad_rules_config
1149
+ create_ad_rule_config = parent_rpcs.create_ad_rule if parent_rpcs.respond_to? :create_ad_rule
1150
+ @create_ad_rule = ::Gapic::Config::Method.new create_ad_rule_config
1151
+ batch_create_ad_rules_config = parent_rpcs.batch_create_ad_rules if parent_rpcs.respond_to? :batch_create_ad_rules
1152
+ @batch_create_ad_rules = ::Gapic::Config::Method.new batch_create_ad_rules_config
1153
+ update_ad_rule_config = parent_rpcs.update_ad_rule if parent_rpcs.respond_to? :update_ad_rule
1154
+ @update_ad_rule = ::Gapic::Config::Method.new update_ad_rule_config
1155
+ batch_update_ad_rules_config = parent_rpcs.batch_update_ad_rules if parent_rpcs.respond_to? :batch_update_ad_rules
1156
+ @batch_update_ad_rules = ::Gapic::Config::Method.new batch_update_ad_rules_config
1157
+ batch_activate_ad_rules_config = parent_rpcs.batch_activate_ad_rules if parent_rpcs.respond_to? :batch_activate_ad_rules
1158
+ @batch_activate_ad_rules = ::Gapic::Config::Method.new batch_activate_ad_rules_config
1159
+ batch_deactivate_ad_rules_config = parent_rpcs.batch_deactivate_ad_rules if parent_rpcs.respond_to? :batch_deactivate_ad_rules
1160
+ @batch_deactivate_ad_rules = ::Gapic::Config::Method.new batch_deactivate_ad_rules_config
1161
+ batch_delete_ad_rules_config = parent_rpcs.batch_delete_ad_rules if parent_rpcs.respond_to? :batch_delete_ad_rules
1162
+ @batch_delete_ad_rules = ::Gapic::Config::Method.new batch_delete_ad_rules_config
1163
+
1164
+ yield self if block_given?
1165
+ end
1166
+ end
1167
+ end
1168
+ end
1169
+ end
1170
+ end
1171
+ end
1172
+ end
1173
+ end
1174
+ end