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,908 @@
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_spot_service_pb"
21
+ require "google/ads/ad_manager/v1/ad_spot_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Ads
25
+ module AdManager
26
+ module V1
27
+ module AdSpotService
28
+ module Rest
29
+ ##
30
+ # REST client for the AdSpotService service.
31
+ #
32
+ # Provides methods for handling `AdSpot` 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_spot_service_stub
45
+
46
+ ##
47
+ # Configure the AdSpotService Client class.
48
+ #
49
+ # See {::Google::Ads::AdManager::V1::AdSpotService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all AdSpotService clients
55
+ # ::Google::Ads::AdManager::V1::AdSpotService::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 AdSpotService 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::AdSpotService::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_spot_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new AdSpotService REST client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Ads::AdManager::V1::AdSpotService::Rest::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Ads::AdManager::V1::AdSpotService::Rest::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the AdSpotService 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_spot_service_stub = ::Google::Ads::AdManager::V1::AdSpotService::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_spot_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_spot_service_stub.logger
175
+ end
176
+
177
+ # Service calls
178
+
179
+ ##
180
+ # Retrieves an `AdSpot` object.
181
+ #
182
+ # @overload get_ad_spot(request, options = nil)
183
+ # Pass arguments to `get_ad_spot` via a request object, either of type
184
+ # {::Google::Ads::AdManager::V1::GetAdSpotRequest} or an equivalent Hash.
185
+ #
186
+ # @param request [::Google::Ads::AdManager::V1::GetAdSpotRequest, ::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_spot(name: nil)
193
+ # Pass arguments to `get_ad_spot` 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 AdSpot.
199
+ # Format: `networks/{network_code}/adSpots/{ad_spot_id}`
200
+ # @yield [result, operation] Access the result along with the TransportOperation object
201
+ # @yieldparam result [::Google::Ads::AdManager::V1::AdSpot]
202
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
203
+ #
204
+ # @return [::Google::Ads::AdManager::V1::AdSpot]
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::AdSpotService::Rest::Client.new
213
+ #
214
+ # # Create a request. To set request fields, pass in keyword arguments.
215
+ # request = Google::Ads::AdManager::V1::GetAdSpotRequest.new
216
+ #
217
+ # # Call the get_ad_spot method.
218
+ # result = client.get_ad_spot request
219
+ #
220
+ # # The returned object is of type Google::Ads::AdManager::V1::AdSpot.
221
+ # p result
222
+ #
223
+ def get_ad_spot 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::GetAdSpotRequest
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_spot.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_spot.timeout,
244
+ metadata: call_metadata,
245
+ retry_policy: @config.rpcs.get_ad_spot.retry_policy
246
+
247
+ options.apply_defaults timeout: @config.timeout,
248
+ metadata: @config.metadata,
249
+ retry_policy: @config.retry_policy
250
+
251
+ @ad_spot_service_stub.get_ad_spot 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 `AdSpot` objects.
260
+ #
261
+ # @overload list_ad_spots(request, options = nil)
262
+ # Pass arguments to `list_ad_spots` via a request object, either of type
263
+ # {::Google::Ads::AdManager::V1::ListAdSpotsRequest} or an equivalent Hash.
264
+ #
265
+ # @param request [::Google::Ads::AdManager::V1::ListAdSpotsRequest, ::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_spots(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, skip: nil)
272
+ # Pass arguments to `list_ad_spots` 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 AdSpots.
278
+ # Format: `networks/{network_code}`
279
+ # @param page_size [::Integer]
280
+ # Optional. The maximum number of `AdSpots` to return. The service may return
281
+ # fewer than this value. If unspecified, at most 50 `AdSpots` 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 `ListAdSpots` call.
286
+ # Provide this to retrieve the subsequent page.
287
+ #
288
+ # When paginating, all other parameters provided to `ListAdSpots` 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>canonicalDisplayName</code></li>
298
+ # <li><code>customSpot</code></li>
299
+ # <li><code>displayName</code></li>
300
+ # <li><code>flexible</code></li>
301
+ # <li><code>name</code></li>
302
+ # </ul>
303
+ # @param order_by [::String]
304
+ # Optional. Expression to specify sorting order.
305
+ # See syntax details at
306
+ # https://developers.google.com/ad-manager/api/beta/filters#order
307
+ # @param skip [::Integer]
308
+ # Optional. Number of individual resources to skip while paginating.
309
+ # @yield [result, operation] Access the result along with the TransportOperation object
310
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::AdSpot>]
311
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
312
+ #
313
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::AdSpot>]
314
+ #
315
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
316
+ #
317
+ # @example Basic example
318
+ # require "google/ads/ad_manager/v1"
319
+ #
320
+ # # Create a client object. The client can be reused for multiple calls.
321
+ # client = Google::Ads::AdManager::V1::AdSpotService::Rest::Client.new
322
+ #
323
+ # # Create a request. To set request fields, pass in keyword arguments.
324
+ # request = Google::Ads::AdManager::V1::ListAdSpotsRequest.new
325
+ #
326
+ # # Call the list_ad_spots method.
327
+ # result = client.list_ad_spots request
328
+ #
329
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
330
+ # # over elements, and API calls will be issued to fetch pages as needed.
331
+ # result.each do |item|
332
+ # # Each element is of type ::Google::Ads::AdManager::V1::AdSpot.
333
+ # p item
334
+ # end
335
+ #
336
+ def list_ad_spots request, options = nil
337
+ raise ::ArgumentError, "request must be provided" if request.nil?
338
+
339
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::ListAdSpotsRequest
340
+
341
+ # Converts hash and nil to an options object
342
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
343
+
344
+ # Customize the options with defaults
345
+ call_metadata = @config.rpcs.list_ad_spots.metadata.to_h
346
+
347
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
348
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
349
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
350
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
351
+ transports_version_send: [:rest]
352
+
353
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
354
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
355
+
356
+ options.apply_defaults timeout: @config.rpcs.list_ad_spots.timeout,
357
+ metadata: call_metadata,
358
+ retry_policy: @config.rpcs.list_ad_spots.retry_policy
359
+
360
+ options.apply_defaults timeout: @config.timeout,
361
+ metadata: @config.metadata,
362
+ retry_policy: @config.retry_policy
363
+
364
+ @ad_spot_service_stub.list_ad_spots request, options do |result, operation|
365
+ result = ::Gapic::Rest::PagedEnumerable.new @ad_spot_service_stub, :list_ad_spots, "ad_spots", request, result, options
366
+ yield result, operation if block_given?
367
+ throw :response, result
368
+ end
369
+ rescue ::Gapic::Rest::Error => e
370
+ raise ::Google::Cloud::Error.from_error(e)
371
+ end
372
+
373
+ ##
374
+ # Creates an `AdSpot` object.
375
+ #
376
+ # @overload create_ad_spot(request, options = nil)
377
+ # Pass arguments to `create_ad_spot` via a request object, either of type
378
+ # {::Google::Ads::AdManager::V1::CreateAdSpotRequest} or an equivalent Hash.
379
+ #
380
+ # @param request [::Google::Ads::AdManager::V1::CreateAdSpotRequest, ::Hash]
381
+ # A request object representing the call parameters. Required. To specify no
382
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
383
+ # @param options [::Gapic::CallOptions, ::Hash]
384
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
385
+ #
386
+ # @overload create_ad_spot(parent: nil, ad_spot: nil)
387
+ # Pass arguments to `create_ad_spot` via keyword arguments. Note that at
388
+ # least one keyword argument is required. To specify no parameters, or to keep all
389
+ # the default parameter values, pass an empty Hash as a request object (see above).
390
+ #
391
+ # @param parent [::String]
392
+ # Required. The parent resource where this `AdSpot` will be created.
393
+ # Format: `networks/{network_code}`
394
+ # @param ad_spot [::Google::Ads::AdManager::V1::AdSpot, ::Hash]
395
+ # Required. The `AdSpot` to create.
396
+ # @yield [result, operation] Access the result along with the TransportOperation object
397
+ # @yieldparam result [::Google::Ads::AdManager::V1::AdSpot]
398
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
399
+ #
400
+ # @return [::Google::Ads::AdManager::V1::AdSpot]
401
+ #
402
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
403
+ #
404
+ # @example Basic example
405
+ # require "google/ads/ad_manager/v1"
406
+ #
407
+ # # Create a client object. The client can be reused for multiple calls.
408
+ # client = Google::Ads::AdManager::V1::AdSpotService::Rest::Client.new
409
+ #
410
+ # # Create a request. To set request fields, pass in keyword arguments.
411
+ # request = Google::Ads::AdManager::V1::CreateAdSpotRequest.new
412
+ #
413
+ # # Call the create_ad_spot method.
414
+ # result = client.create_ad_spot request
415
+ #
416
+ # # The returned object is of type Google::Ads::AdManager::V1::AdSpot.
417
+ # p result
418
+ #
419
+ def create_ad_spot request, options = nil
420
+ raise ::ArgumentError, "request must be provided" if request.nil?
421
+
422
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::CreateAdSpotRequest
423
+
424
+ # Converts hash and nil to an options object
425
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
426
+
427
+ # Customize the options with defaults
428
+ call_metadata = @config.rpcs.create_ad_spot.metadata.to_h
429
+
430
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
431
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
432
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
433
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
434
+ transports_version_send: [:rest]
435
+
436
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
437
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
438
+
439
+ options.apply_defaults timeout: @config.rpcs.create_ad_spot.timeout,
440
+ metadata: call_metadata,
441
+ retry_policy: @config.rpcs.create_ad_spot.retry_policy
442
+
443
+ options.apply_defaults timeout: @config.timeout,
444
+ metadata: @config.metadata,
445
+ retry_policy: @config.retry_policy
446
+
447
+ @ad_spot_service_stub.create_ad_spot request, options do |result, operation|
448
+ yield result, operation if block_given?
449
+ end
450
+ rescue ::Gapic::Rest::Error => e
451
+ raise ::Google::Cloud::Error.from_error(e)
452
+ end
453
+
454
+ ##
455
+ # Batch creates `AdSpot` objects.
456
+ #
457
+ # @overload batch_create_ad_spots(request, options = nil)
458
+ # Pass arguments to `batch_create_ad_spots` via a request object, either of type
459
+ # {::Google::Ads::AdManager::V1::BatchCreateAdSpotsRequest} or an equivalent Hash.
460
+ #
461
+ # @param request [::Google::Ads::AdManager::V1::BatchCreateAdSpotsRequest, ::Hash]
462
+ # A request object representing the call parameters. Required. To specify no
463
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
464
+ # @param options [::Gapic::CallOptions, ::Hash]
465
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
466
+ #
467
+ # @overload batch_create_ad_spots(parent: nil, requests: nil)
468
+ # Pass arguments to `batch_create_ad_spots` via keyword arguments. Note that at
469
+ # least one keyword argument is required. To specify no parameters, or to keep all
470
+ # the default parameter values, pass an empty Hash as a request object (see above).
471
+ #
472
+ # @param parent [::String]
473
+ # Required. The parent resource where `AdSpots` will be created.
474
+ # Format: `networks/{network_code}`
475
+ # The parent field in the CreateAdSpotRequest must match this
476
+ # field.
477
+ # @param requests [::Array<::Google::Ads::AdManager::V1::CreateAdSpotRequest, ::Hash>]
478
+ # Required. The `AdSpot` objects to create.
479
+ # A maximum of 100 objects can be created in a batch.
480
+ # @yield [result, operation] Access the result along with the TransportOperation object
481
+ # @yieldparam result [::Google::Ads::AdManager::V1::BatchCreateAdSpotsResponse]
482
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
483
+ #
484
+ # @return [::Google::Ads::AdManager::V1::BatchCreateAdSpotsResponse]
485
+ #
486
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
487
+ #
488
+ # @example Basic example
489
+ # require "google/ads/ad_manager/v1"
490
+ #
491
+ # # Create a client object. The client can be reused for multiple calls.
492
+ # client = Google::Ads::AdManager::V1::AdSpotService::Rest::Client.new
493
+ #
494
+ # # Create a request. To set request fields, pass in keyword arguments.
495
+ # request = Google::Ads::AdManager::V1::BatchCreateAdSpotsRequest.new
496
+ #
497
+ # # Call the batch_create_ad_spots method.
498
+ # result = client.batch_create_ad_spots request
499
+ #
500
+ # # The returned object is of type Google::Ads::AdManager::V1::BatchCreateAdSpotsResponse.
501
+ # p result
502
+ #
503
+ def batch_create_ad_spots request, options = nil
504
+ raise ::ArgumentError, "request must be provided" if request.nil?
505
+
506
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchCreateAdSpotsRequest
507
+
508
+ # Converts hash and nil to an options object
509
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
510
+
511
+ # Customize the options with defaults
512
+ call_metadata = @config.rpcs.batch_create_ad_spots.metadata.to_h
513
+
514
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
515
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
516
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
517
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
518
+ transports_version_send: [:rest]
519
+
520
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
521
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
522
+
523
+ options.apply_defaults timeout: @config.rpcs.batch_create_ad_spots.timeout,
524
+ metadata: call_metadata,
525
+ retry_policy: @config.rpcs.batch_create_ad_spots.retry_policy
526
+
527
+ options.apply_defaults timeout: @config.timeout,
528
+ metadata: @config.metadata,
529
+ retry_policy: @config.retry_policy
530
+
531
+ @ad_spot_service_stub.batch_create_ad_spots request, options do |result, operation|
532
+ yield result, operation if block_given?
533
+ end
534
+ rescue ::Gapic::Rest::Error => e
535
+ raise ::Google::Cloud::Error.from_error(e)
536
+ end
537
+
538
+ ##
539
+ # Updates an `AdSpot` object.
540
+ #
541
+ # @overload update_ad_spot(request, options = nil)
542
+ # Pass arguments to `update_ad_spot` via a request object, either of type
543
+ # {::Google::Ads::AdManager::V1::UpdateAdSpotRequest} or an equivalent Hash.
544
+ #
545
+ # @param request [::Google::Ads::AdManager::V1::UpdateAdSpotRequest, ::Hash]
546
+ # A request object representing the call parameters. Required. To specify no
547
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
548
+ # @param options [::Gapic::CallOptions, ::Hash]
549
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
550
+ #
551
+ # @overload update_ad_spot(ad_spot: nil, update_mask: nil)
552
+ # Pass arguments to `update_ad_spot` via keyword arguments. Note that at
553
+ # least one keyword argument is required. To specify no parameters, or to keep all
554
+ # the default parameter values, pass an empty Hash as a request object (see above).
555
+ #
556
+ # @param ad_spot [::Google::Ads::AdManager::V1::AdSpot, ::Hash]
557
+ # Required. The `AdSpot` to update.
558
+ #
559
+ # The `AdSpot`'s `name` is used to identify the `AdSpot` to update.
560
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
561
+ # Optional. The list of fields to update.
562
+ # @yield [result, operation] Access the result along with the TransportOperation object
563
+ # @yieldparam result [::Google::Ads::AdManager::V1::AdSpot]
564
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
565
+ #
566
+ # @return [::Google::Ads::AdManager::V1::AdSpot]
567
+ #
568
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
569
+ #
570
+ # @example Basic example
571
+ # require "google/ads/ad_manager/v1"
572
+ #
573
+ # # Create a client object. The client can be reused for multiple calls.
574
+ # client = Google::Ads::AdManager::V1::AdSpotService::Rest::Client.new
575
+ #
576
+ # # Create a request. To set request fields, pass in keyword arguments.
577
+ # request = Google::Ads::AdManager::V1::UpdateAdSpotRequest.new
578
+ #
579
+ # # Call the update_ad_spot method.
580
+ # result = client.update_ad_spot request
581
+ #
582
+ # # The returned object is of type Google::Ads::AdManager::V1::AdSpot.
583
+ # p result
584
+ #
585
+ def update_ad_spot request, options = nil
586
+ raise ::ArgumentError, "request must be provided" if request.nil?
587
+
588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::UpdateAdSpotRequest
589
+
590
+ # Converts hash and nil to an options object
591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
592
+
593
+ # Customize the options with defaults
594
+ call_metadata = @config.rpcs.update_ad_spot.metadata.to_h
595
+
596
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
597
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
599
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
600
+ transports_version_send: [:rest]
601
+
602
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
603
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
604
+
605
+ options.apply_defaults timeout: @config.rpcs.update_ad_spot.timeout,
606
+ metadata: call_metadata,
607
+ retry_policy: @config.rpcs.update_ad_spot.retry_policy
608
+
609
+ options.apply_defaults timeout: @config.timeout,
610
+ metadata: @config.metadata,
611
+ retry_policy: @config.retry_policy
612
+
613
+ @ad_spot_service_stub.update_ad_spot request, options do |result, operation|
614
+ yield result, operation if block_given?
615
+ end
616
+ rescue ::Gapic::Rest::Error => e
617
+ raise ::Google::Cloud::Error.from_error(e)
618
+ end
619
+
620
+ ##
621
+ # Batch updates `AdSpot` objects.
622
+ #
623
+ # @overload batch_update_ad_spots(request, options = nil)
624
+ # Pass arguments to `batch_update_ad_spots` via a request object, either of type
625
+ # {::Google::Ads::AdManager::V1::BatchUpdateAdSpotsRequest} or an equivalent Hash.
626
+ #
627
+ # @param request [::Google::Ads::AdManager::V1::BatchUpdateAdSpotsRequest, ::Hash]
628
+ # A request object representing the call parameters. Required. To specify no
629
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
630
+ # @param options [::Gapic::CallOptions, ::Hash]
631
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
632
+ #
633
+ # @overload batch_update_ad_spots(parent: nil, requests: nil)
634
+ # Pass arguments to `batch_update_ad_spots` via keyword arguments. Note that at
635
+ # least one keyword argument is required. To specify no parameters, or to keep all
636
+ # the default parameter values, pass an empty Hash as a request object (see above).
637
+ #
638
+ # @param parent [::String]
639
+ # Required. The parent resource where `AdSpots` will be updated.
640
+ # Format: `networks/{network_code}`
641
+ # The parent field in the UpdateAdSpotRequest must match this
642
+ # field.
643
+ # @param requests [::Array<::Google::Ads::AdManager::V1::UpdateAdSpotRequest, ::Hash>]
644
+ # Required. The `AdSpot` objects to update.
645
+ # A maximum of 100 objects can be updated in a batch.
646
+ # @yield [result, operation] Access the result along with the TransportOperation object
647
+ # @yieldparam result [::Google::Ads::AdManager::V1::BatchUpdateAdSpotsResponse]
648
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
649
+ #
650
+ # @return [::Google::Ads::AdManager::V1::BatchUpdateAdSpotsResponse]
651
+ #
652
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
653
+ #
654
+ # @example Basic example
655
+ # require "google/ads/ad_manager/v1"
656
+ #
657
+ # # Create a client object. The client can be reused for multiple calls.
658
+ # client = Google::Ads::AdManager::V1::AdSpotService::Rest::Client.new
659
+ #
660
+ # # Create a request. To set request fields, pass in keyword arguments.
661
+ # request = Google::Ads::AdManager::V1::BatchUpdateAdSpotsRequest.new
662
+ #
663
+ # # Call the batch_update_ad_spots method.
664
+ # result = client.batch_update_ad_spots request
665
+ #
666
+ # # The returned object is of type Google::Ads::AdManager::V1::BatchUpdateAdSpotsResponse.
667
+ # p result
668
+ #
669
+ def batch_update_ad_spots request, options = nil
670
+ raise ::ArgumentError, "request must be provided" if request.nil?
671
+
672
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchUpdateAdSpotsRequest
673
+
674
+ # Converts hash and nil to an options object
675
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
676
+
677
+ # Customize the options with defaults
678
+ call_metadata = @config.rpcs.batch_update_ad_spots.metadata.to_h
679
+
680
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
681
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
682
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
683
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
684
+ transports_version_send: [:rest]
685
+
686
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
687
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
688
+
689
+ options.apply_defaults timeout: @config.rpcs.batch_update_ad_spots.timeout,
690
+ metadata: call_metadata,
691
+ retry_policy: @config.rpcs.batch_update_ad_spots.retry_policy
692
+
693
+ options.apply_defaults timeout: @config.timeout,
694
+ metadata: @config.metadata,
695
+ retry_policy: @config.retry_policy
696
+
697
+ @ad_spot_service_stub.batch_update_ad_spots request, options do |result, operation|
698
+ yield result, operation if block_given?
699
+ end
700
+ rescue ::Gapic::Rest::Error => e
701
+ raise ::Google::Cloud::Error.from_error(e)
702
+ end
703
+
704
+ ##
705
+ # Configuration class for the AdSpotService REST API.
706
+ #
707
+ # This class represents the configuration for AdSpotService REST,
708
+ # providing control over timeouts, retry behavior, logging, transport
709
+ # parameters, and other low-level controls. Certain parameters can also be
710
+ # applied individually to specific RPCs. See
711
+ # {::Google::Ads::AdManager::V1::AdSpotService::Rest::Client::Configuration::Rpcs}
712
+ # for a list of RPCs that can be configured independently.
713
+ #
714
+ # Configuration can be applied globally to all clients, or to a single client
715
+ # on construction.
716
+ #
717
+ # @example
718
+ #
719
+ # # Modify the global config, setting the timeout for
720
+ # # get_ad_spot to 20 seconds,
721
+ # # and all remaining timeouts to 10 seconds.
722
+ # ::Google::Ads::AdManager::V1::AdSpotService::Rest::Client.configure do |config|
723
+ # config.timeout = 10.0
724
+ # config.rpcs.get_ad_spot.timeout = 20.0
725
+ # end
726
+ #
727
+ # # Apply the above configuration only to a new client.
728
+ # client = ::Google::Ads::AdManager::V1::AdSpotService::Rest::Client.new do |config|
729
+ # config.timeout = 10.0
730
+ # config.rpcs.get_ad_spot.timeout = 20.0
731
+ # end
732
+ #
733
+ # @!attribute [rw] endpoint
734
+ # A custom service endpoint, as a hostname or hostname:port. The default is
735
+ # nil, indicating to use the default endpoint in the current universe domain.
736
+ # @return [::String,nil]
737
+ # @!attribute [rw] credentials
738
+ # Credentials to send with calls. You may provide any of the following types:
739
+ # * (`String`) The path to a service account key file in JSON format
740
+ # * (`Hash`) A service account key as a Hash
741
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
742
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
743
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
744
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
745
+ # * (`nil`) indicating no credentials
746
+ #
747
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
748
+ # external source for authentication to Google Cloud, you must validate it before
749
+ # providing it to a Google API client library. Providing an unvalidated credential
750
+ # configuration to Google APIs can compromise the security of your systems and data.
751
+ # For more information, refer to [Validate credential configurations from external
752
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
753
+ # @return [::Object]
754
+ # @!attribute [rw] scope
755
+ # The OAuth scopes
756
+ # @return [::Array<::String>]
757
+ # @!attribute [rw] lib_name
758
+ # The library name as recorded in instrumentation and logging
759
+ # @return [::String]
760
+ # @!attribute [rw] lib_version
761
+ # The library version as recorded in instrumentation and logging
762
+ # @return [::String]
763
+ # @!attribute [rw] timeout
764
+ # The call timeout in seconds.
765
+ # @return [::Numeric]
766
+ # @!attribute [rw] metadata
767
+ # Additional headers to be sent with the call.
768
+ # @return [::Hash{::Symbol=>::String}]
769
+ # @!attribute [rw] retry_policy
770
+ # The retry policy. The value is a hash with the following keys:
771
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
772
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
773
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
774
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
775
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
776
+ # trigger a retry.
777
+ # @return [::Hash]
778
+ # @!attribute [rw] quota_project
779
+ # A separate project against which to charge quota.
780
+ # @return [::String]
781
+ # @!attribute [rw] universe_domain
782
+ # The universe domain within which to make requests. This determines the
783
+ # default endpoint URL. The default value of nil uses the environment
784
+ # universe (usually the default "googleapis.com" universe).
785
+ # @return [::String,nil]
786
+ # @!attribute [rw] logger
787
+ # A custom logger to use for request/response debug logging, or the value
788
+ # `:default` (the default) to construct a default logger, or `nil` to
789
+ # explicitly disable logging.
790
+ # @return [::Logger,:default,nil]
791
+ #
792
+ class Configuration
793
+ extend ::Gapic::Config
794
+
795
+ # @private
796
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
797
+ DEFAULT_ENDPOINT = "admanager.googleapis.com"
798
+
799
+ config_attr :endpoint, nil, ::String, nil
800
+ config_attr :credentials, nil do |value|
801
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
802
+ allowed.any? { |klass| klass === value }
803
+ end
804
+ config_attr :scope, nil, ::String, ::Array, nil
805
+ config_attr :lib_name, nil, ::String, nil
806
+ config_attr :lib_version, nil, ::String, nil
807
+ config_attr :timeout, nil, ::Numeric, nil
808
+ config_attr :metadata, nil, ::Hash, nil
809
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
810
+ config_attr :quota_project, nil, ::String, nil
811
+ config_attr :universe_domain, nil, ::String, nil
812
+ config_attr :logger, :default, ::Logger, nil, :default
813
+
814
+ # @private
815
+ def initialize parent_config = nil
816
+ @parent_config = parent_config unless parent_config.nil?
817
+
818
+ yield self if block_given?
819
+ end
820
+
821
+ ##
822
+ # Configurations for individual RPCs
823
+ # @return [Rpcs]
824
+ #
825
+ def rpcs
826
+ @rpcs ||= begin
827
+ parent_rpcs = nil
828
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
829
+ Rpcs.new parent_rpcs
830
+ end
831
+ end
832
+
833
+ ##
834
+ # Configuration RPC class for the AdSpotService API.
835
+ #
836
+ # Includes fields providing the configuration for each RPC in this service.
837
+ # Each configuration object is of type `Gapic::Config::Method` and includes
838
+ # the following configuration fields:
839
+ #
840
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
841
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
842
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
843
+ # include the following keys:
844
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
845
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
846
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
847
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
848
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
849
+ # trigger a retry.
850
+ #
851
+ class Rpcs
852
+ ##
853
+ # RPC-specific configuration for `get_ad_spot`
854
+ # @return [::Gapic::Config::Method]
855
+ #
856
+ attr_reader :get_ad_spot
857
+ ##
858
+ # RPC-specific configuration for `list_ad_spots`
859
+ # @return [::Gapic::Config::Method]
860
+ #
861
+ attr_reader :list_ad_spots
862
+ ##
863
+ # RPC-specific configuration for `create_ad_spot`
864
+ # @return [::Gapic::Config::Method]
865
+ #
866
+ attr_reader :create_ad_spot
867
+ ##
868
+ # RPC-specific configuration for `batch_create_ad_spots`
869
+ # @return [::Gapic::Config::Method]
870
+ #
871
+ attr_reader :batch_create_ad_spots
872
+ ##
873
+ # RPC-specific configuration for `update_ad_spot`
874
+ # @return [::Gapic::Config::Method]
875
+ #
876
+ attr_reader :update_ad_spot
877
+ ##
878
+ # RPC-specific configuration for `batch_update_ad_spots`
879
+ # @return [::Gapic::Config::Method]
880
+ #
881
+ attr_reader :batch_update_ad_spots
882
+
883
+ # @private
884
+ def initialize parent_rpcs = nil
885
+ get_ad_spot_config = parent_rpcs.get_ad_spot if parent_rpcs.respond_to? :get_ad_spot
886
+ @get_ad_spot = ::Gapic::Config::Method.new get_ad_spot_config
887
+ list_ad_spots_config = parent_rpcs.list_ad_spots if parent_rpcs.respond_to? :list_ad_spots
888
+ @list_ad_spots = ::Gapic::Config::Method.new list_ad_spots_config
889
+ create_ad_spot_config = parent_rpcs.create_ad_spot if parent_rpcs.respond_to? :create_ad_spot
890
+ @create_ad_spot = ::Gapic::Config::Method.new create_ad_spot_config
891
+ batch_create_ad_spots_config = parent_rpcs.batch_create_ad_spots if parent_rpcs.respond_to? :batch_create_ad_spots
892
+ @batch_create_ad_spots = ::Gapic::Config::Method.new batch_create_ad_spots_config
893
+ update_ad_spot_config = parent_rpcs.update_ad_spot if parent_rpcs.respond_to? :update_ad_spot
894
+ @update_ad_spot = ::Gapic::Config::Method.new update_ad_spot_config
895
+ batch_update_ad_spots_config = parent_rpcs.batch_update_ad_spots if parent_rpcs.respond_to? :batch_update_ad_spots
896
+ @batch_update_ad_spots = ::Gapic::Config::Method.new batch_update_ad_spots_config
897
+
898
+ yield self if block_given?
899
+ end
900
+ end
901
+ end
902
+ end
903
+ end
904
+ end
905
+ end
906
+ end
907
+ end
908
+ end