google-ads-ad_manager-v1 0.a → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/ads/ad_manager/v1/ad_unit_service/credentials.rb +44 -0
  6. data/lib/google/ads/ad_manager/v1/ad_unit_service/paths.rb +64 -0
  7. data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/client.rb +644 -0
  8. data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/service_stub.rb +264 -0
  9. data/lib/google/ads/ad_manager/v1/ad_unit_service/rest.rb +52 -0
  10. data/lib/google/ads/ad_manager/v1/ad_unit_service.rb +48 -0
  11. data/lib/google/ads/ad_manager/v1/company_service/credentials.rb +44 -0
  12. data/lib/google/ads/ad_manager/v1/company_service/paths.rb +64 -0
  13. data/lib/google/ads/ad_manager/v1/company_service/rest/client.rb +531 -0
  14. data/lib/google/ads/ad_manager/v1/company_service/rest/service_stub.rb +203 -0
  15. data/lib/google/ads/ad_manager/v1/company_service/rest.rb +52 -0
  16. data/lib/google/ads/ad_manager/v1/company_service.rb +48 -0
  17. data/lib/google/ads/ad_manager/v1/custom_field_service/credentials.rb +44 -0
  18. data/lib/google/ads/ad_manager/v1/custom_field_service/paths.rb +64 -0
  19. data/lib/google/ads/ad_manager/v1/custom_field_service/rest/client.rb +531 -0
  20. data/lib/google/ads/ad_manager/v1/custom_field_service/rest/service_stub.rb +203 -0
  21. data/lib/google/ads/ad_manager/v1/custom_field_service/rest.rb +52 -0
  22. data/lib/google/ads/ad_manager/v1/custom_field_service.rb +48 -0
  23. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/credentials.rb +44 -0
  24. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/paths.rb +64 -0
  25. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/client.rb +532 -0
  26. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/service_stub.rb +203 -0
  27. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest.rb +52 -0
  28. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service.rb +48 -0
  29. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/credentials.rb +44 -0
  30. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/paths.rb +69 -0
  31. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/client.rb +535 -0
  32. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/service_stub.rb +203 -0
  33. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest.rb +52 -0
  34. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service.rb +48 -0
  35. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/credentials.rb +44 -0
  36. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/paths.rb +64 -0
  37. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/client.rb +894 -0
  38. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/service_stub.rb +451 -0
  39. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest.rb +52 -0
  40. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service.rb +48 -0
  41. data/lib/google/ads/ad_manager/v1/network_service/credentials.rb +44 -0
  42. data/lib/google/ads/ad_manager/v1/network_service/paths.rb +47 -0
  43. data/lib/google/ads/ad_manager/v1/network_service/rest/client.rb +495 -0
  44. data/lib/google/ads/ad_manager/v1/network_service/rest/service_stub.rb +201 -0
  45. data/lib/google/ads/ad_manager/v1/network_service/rest.rb +52 -0
  46. data/lib/google/ads/ad_manager/v1/network_service.rb +48 -0
  47. data/lib/google/ads/ad_manager/v1/order_service/credentials.rb +44 -0
  48. data/lib/google/ads/ad_manager/v1/order_service/paths.rb +64 -0
  49. data/lib/google/ads/ad_manager/v1/order_service/rest/client.rb +541 -0
  50. data/lib/google/ads/ad_manager/v1/order_service/rest/service_stub.rb +203 -0
  51. data/lib/google/ads/ad_manager/v1/order_service/rest.rb +52 -0
  52. data/lib/google/ads/ad_manager/v1/order_service.rb +48 -0
  53. data/lib/google/ads/ad_manager/v1/placement_service/credentials.rb +44 -0
  54. data/lib/google/ads/ad_manager/v1/placement_service/paths.rb +64 -0
  55. data/lib/google/ads/ad_manager/v1/placement_service/rest/client.rb +531 -0
  56. data/lib/google/ads/ad_manager/v1/placement_service/rest/service_stub.rb +203 -0
  57. data/lib/google/ads/ad_manager/v1/placement_service/rest.rb +52 -0
  58. data/lib/google/ads/ad_manager/v1/placement_service.rb +48 -0
  59. data/lib/google/ads/ad_manager/v1/report_service/credentials.rb +44 -0
  60. data/lib/google/ads/ad_manager/v1/report_service/paths.rb +64 -0
  61. data/lib/google/ads/ad_manager/v1/report_service/rest/client.rb +923 -0
  62. data/lib/google/ads/ad_manager/v1/report_service/rest/operations.rb +914 -0
  63. data/lib/google/ads/ad_manager/v1/report_service/rest/service_stub.rb +450 -0
  64. data/lib/google/ads/ad_manager/v1/report_service/rest.rb +53 -0
  65. data/lib/google/ads/ad_manager/v1/report_service.rb +48 -0
  66. data/lib/google/ads/ad_manager/v1/rest.rb +49 -0
  67. data/lib/google/ads/ad_manager/v1/role_service/credentials.rb +44 -0
  68. data/lib/google/ads/ad_manager/v1/role_service/paths.rb +64 -0
  69. data/lib/google/ads/ad_manager/v1/role_service/rest/client.rb +530 -0
  70. data/lib/google/ads/ad_manager/v1/role_service/rest/service_stub.rb +203 -0
  71. data/lib/google/ads/ad_manager/v1/role_service/rest.rb +52 -0
  72. data/lib/google/ads/ad_manager/v1/role_service.rb +48 -0
  73. data/lib/google/ads/ad_manager/v1/taxonomy_category_service/credentials.rb +44 -0
  74. data/lib/google/ads/ad_manager/v1/taxonomy_category_service/paths.rb +64 -0
  75. data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/client.rb +531 -0
  76. data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/service_stub.rb +203 -0
  77. data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest.rb +52 -0
  78. data/lib/google/ads/ad_manager/v1/taxonomy_category_service.rb +48 -0
  79. data/lib/google/ads/ad_manager/v1/user_service/credentials.rb +44 -0
  80. data/lib/google/ads/ad_manager/v1/user_service/paths.rb +50 -0
  81. data/lib/google/ads/ad_manager/v1/user_service/rest/client.rb +421 -0
  82. data/lib/google/ads/ad_manager/v1/user_service/rest/service_stub.rb +142 -0
  83. data/lib/google/ads/ad_manager/v1/user_service/rest.rb +52 -0
  84. data/lib/google/ads/ad_manager/v1/user_service.rb +48 -0
  85. data/lib/google/ads/ad_manager/v1/version.rb +7 -2
  86. data/lib/google/ads/ad_manager/v1.rb +52 -0
  87. data/lib/google/ads/admanager/v1/ad_unit_enums_pb.rb +47 -0
  88. data/lib/google/ads/admanager/v1/ad_unit_messages_pb.rb +60 -0
  89. data/lib/google/ads/admanager/v1/ad_unit_service_pb.rb +53 -0
  90. data/lib/google/ads/admanager/v1/ad_unit_service_services_pb.rb +49 -0
  91. data/lib/google/ads/admanager/v1/admanager_error_pb.rb +45 -0
  92. data/lib/google/ads/admanager/v1/applied_label_pb.rb +45 -0
  93. data/lib/google/ads/admanager/v1/company_credit_status_enum_pb.rb +43 -0
  94. data/lib/google/ads/admanager/v1/company_messages_pb.rb +51 -0
  95. data/lib/google/ads/admanager/v1/company_service_pb.rb +51 -0
  96. data/lib/google/ads/admanager/v1/company_service_services_pb.rb +47 -0
  97. data/lib/google/ads/admanager/v1/company_type_enum_pb.rb +43 -0
  98. data/lib/google/ads/admanager/v1/contact_messages_pb.rb +45 -0
  99. data/lib/google/ads/admanager/v1/custom_field_enums_pb.rb +49 -0
  100. data/lib/google/ads/admanager/v1/custom_field_messages_pb.rb +47 -0
  101. data/lib/google/ads/admanager/v1/custom_field_service_pb.rb +51 -0
  102. data/lib/google/ads/admanager/v1/custom_field_service_services_pb.rb +47 -0
  103. data/lib/google/ads/admanager/v1/custom_field_value_pb.rb +46 -0
  104. data/lib/google/ads/admanager/v1/custom_targeting_key_enums_pb.rb +47 -0
  105. data/lib/google/ads/admanager/v1/custom_targeting_key_messages_pb.rb +46 -0
  106. data/lib/google/ads/admanager/v1/custom_targeting_key_service_pb.rb +51 -0
  107. data/lib/google/ads/admanager/v1/custom_targeting_key_service_services_pb.rb +47 -0
  108. data/lib/google/ads/admanager/v1/custom_targeting_value_enums_pb.rb +45 -0
  109. data/lib/google/ads/admanager/v1/custom_targeting_value_messages_pb.rb +46 -0
  110. data/lib/google/ads/admanager/v1/custom_targeting_value_service_pb.rb +51 -0
  111. data/lib/google/ads/admanager/v1/custom_targeting_value_service_services_pb.rb +47 -0
  112. data/lib/google/ads/admanager/v1/entity_signals_mapping_messages_pb.rb +45 -0
  113. data/lib/google/ads/admanager/v1/entity_signals_mapping_service_pb.rb +59 -0
  114. data/lib/google/ads/admanager/v1/entity_signals_mapping_service_services_pb.rb +55 -0
  115. data/lib/google/ads/admanager/v1/environment_type_enum_pb.rb +43 -0
  116. data/lib/google/ads/admanager/v1/frequency_cap_pb.rb +44 -0
  117. data/lib/google/ads/admanager/v1/label_messages_pb.rb +45 -0
  118. data/lib/google/ads/admanager/v1/network_messages_pb.rb +45 -0
  119. data/lib/google/ads/admanager/v1/network_service_pb.rb +51 -0
  120. data/lib/google/ads/admanager/v1/network_service_services_pb.rb +47 -0
  121. data/lib/google/ads/admanager/v1/order_enums_pb.rb +43 -0
  122. data/lib/google/ads/admanager/v1/order_messages_pb.rb +52 -0
  123. data/lib/google/ads/admanager/v1/order_service_pb.rb +51 -0
  124. data/lib/google/ads/admanager/v1/order_service_services_pb.rb +52 -0
  125. data/lib/google/ads/admanager/v1/placement_enums_pb.rb +43 -0
  126. data/lib/google/ads/admanager/v1/placement_messages_pb.rb +48 -0
  127. data/lib/google/ads/admanager/v1/placement_service_pb.rb +51 -0
  128. data/lib/google/ads/admanager/v1/placement_service_services_pb.rb +47 -0
  129. data/lib/google/ads/admanager/v1/report_service_pb.rb +97 -0
  130. data/lib/google/ads/admanager/v1/report_service_services_pb.rb +65 -0
  131. data/lib/google/ads/admanager/v1/role_enums_pb.rb +43 -0
  132. data/lib/google/ads/admanager/v1/role_messages_pb.rb +46 -0
  133. data/lib/google/ads/admanager/v1/role_service_pb.rb +51 -0
  134. data/lib/google/ads/admanager/v1/role_service_services_pb.rb +47 -0
  135. data/lib/google/ads/admanager/v1/size_pb.rb +45 -0
  136. data/lib/google/ads/admanager/v1/size_type_enum_pb.rb +43 -0
  137. data/lib/google/ads/admanager/v1/taxonomy_category_messages_pb.rb +46 -0
  138. data/lib/google/ads/admanager/v1/taxonomy_category_service_pb.rb +51 -0
  139. data/lib/google/ads/admanager/v1/taxonomy_category_service_services_pb.rb +47 -0
  140. data/lib/google/ads/admanager/v1/taxonomy_type_enum_pb.rb +43 -0
  141. data/lib/google/ads/admanager/v1/team_messages_pb.rb +45 -0
  142. data/lib/google/ads/admanager/v1/time_unit_enum_pb.rb +43 -0
  143. data/lib/google/ads/admanager/v1/user_messages_pb.rb +45 -0
  144. data/lib/google/ads/admanager/v1/user_service_pb.rb +48 -0
  145. data/lib/google/ads/admanager/v1/user_service_services_pb.rb +48 -0
  146. data/lib/google-ads-ad_manager-v1.rb +21 -0
  147. data/proto_docs/README.md +4 -0
  148. data/proto_docs/google/ads/admanager/v1/ad_unit_enums.rb +91 -0
  149. data/proto_docs/google/ads/admanager/v1/ad_unit_messages.rb +188 -0
  150. data/proto_docs/google/ads/admanager/v1/ad_unit_service.rb +160 -0
  151. data/proto_docs/google/ads/admanager/v1/admanager_error.rb +54 -0
  152. data/proto_docs/google/ads/admanager/v1/applied_label.rb +39 -0
  153. data/proto_docs/google/ads/admanager/v1/company_credit_status_enum.rb +101 -0
  154. data/proto_docs/google/ads/admanager/v1/company_messages.rb +101 -0
  155. data/proto_docs/google/ads/admanager/v1/company_service.rb +99 -0
  156. data/proto_docs/google/ads/admanager/v1/company_type_enum.rb +55 -0
  157. data/proto_docs/google/ads/admanager/v1/contact_messages.rb +43 -0
  158. data/proto_docs/google/ads/admanager/v1/custom_field_enums.rb +123 -0
  159. data/proto_docs/google/ads/admanager/v1/custom_field_messages.rb +78 -0
  160. data/proto_docs/google/ads/admanager/v1/custom_field_service.rb +99 -0
  161. data/proto_docs/google/ads/admanager/v1/custom_field_value.rb +58 -0
  162. data/proto_docs/google/ads/admanager/v1/custom_targeting_key_enums.rb +86 -0
  163. data/proto_docs/google/ads/admanager/v1/custom_targeting_key_messages.rb +59 -0
  164. data/proto_docs/google/ads/admanager/v1/custom_targeting_key_service.rb +100 -0
  165. data/proto_docs/google/ads/admanager/v1/custom_targeting_value_enums.rb +97 -0
  166. data/proto_docs/google/ads/admanager/v1/custom_targeting_value_messages.rb +54 -0
  167. data/proto_docs/google/ads/admanager/v1/custom_targeting_value_service.rb +103 -0
  168. data/proto_docs/google/ads/admanager/v1/entity_signals_mapping_messages.rb +53 -0
  169. data/proto_docs/google/ads/admanager/v1/entity_signals_mapping_service.rb +180 -0
  170. data/proto_docs/google/ads/admanager/v1/environment_type_enum.rb +45 -0
  171. data/proto_docs/google/ads/admanager/v1/frequency_cap.rb +41 -0
  172. data/proto_docs/google/ads/admanager/v1/label_messages.rb +36 -0
  173. data/proto_docs/google/ads/admanager/v1/network_messages.rb +67 -0
  174. data/proto_docs/google/ads/admanager/v1/network_service.rb +51 -0
  175. data/proto_docs/google/ads/admanager/v1/order_enums.rb +63 -0
  176. data/proto_docs/google/ads/admanager/v1/order_messages.rb +149 -0
  177. data/proto_docs/google/ads/admanager/v1/order_service.rb +99 -0
  178. data/proto_docs/google/ads/admanager/v1/placement_enums.rb +48 -0
  179. data/proto_docs/google/ads/admanager/v1/placement_messages.rb +62 -0
  180. data/proto_docs/google/ads/admanager/v1/placement_service.rb +99 -0
  181. data/proto_docs/google/ads/admanager/v1/report_service.rb +3476 -0
  182. data/proto_docs/google/ads/admanager/v1/role_enums.rb +45 -0
  183. data/proto_docs/google/ads/admanager/v1/role_messages.rb +51 -0
  184. data/proto_docs/google/ads/admanager/v1/role_service.rb +97 -0
  185. data/proto_docs/google/ads/admanager/v1/size.rb +48 -0
  186. data/proto_docs/google/ads/admanager/v1/size_type_enum.rb +66 -0
  187. data/proto_docs/google/ads/admanager/v1/taxonomy_category_messages.rb +59 -0
  188. data/proto_docs/google/ads/admanager/v1/taxonomy_category_service.rb +99 -0
  189. data/proto_docs/google/ads/admanager/v1/taxonomy_type_enum.rb +55 -0
  190. data/proto_docs/google/ads/admanager/v1/team_messages.rb +40 -0
  191. data/proto_docs/google/ads/admanager/v1/time_unit_enum.rb +63 -0
  192. data/proto_docs/google/ads/admanager/v1/user_messages.rb +69 -0
  193. data/proto_docs/google/ads/admanager/v1/user_service.rb +36 -0
  194. data/proto_docs/google/api/client.rb +459 -0
  195. data/proto_docs/google/api/field_behavior.rb +85 -0
  196. data/proto_docs/google/api/launch_stage.rb +71 -0
  197. data/proto_docs/google/api/resource.rb +227 -0
  198. data/proto_docs/google/longrunning/operations.rb +169 -0
  199. data/proto_docs/google/protobuf/any.rb +145 -0
  200. data/proto_docs/google/protobuf/duration.rb +98 -0
  201. data/proto_docs/google/protobuf/empty.rb +34 -0
  202. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  203. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  204. data/proto_docs/google/rpc/status.rb +48 -0
  205. data/proto_docs/google/type/date.rb +53 -0
  206. data/proto_docs/google/type/dayofweek.rb +49 -0
  207. data/proto_docs/google/type/timeofday.rb +45 -0
  208. metadata +248 -11
@@ -0,0 +1,421 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/user_service_pb"
21
+ require "google/ads/ad_manager/v1/user_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Ads
25
+ module AdManager
26
+ module V1
27
+ module UserService
28
+ module Rest
29
+ ##
30
+ # REST client for the UserService service.
31
+ #
32
+ # Provides methods for handling User 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 :user_service_stub
45
+
46
+ ##
47
+ # Configure the UserService Client class.
48
+ #
49
+ # See {::Google::Ads::AdManager::V1::UserService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all UserService clients
55
+ # ::Google::Ads::AdManager::V1::UserService::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 UserService 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::UserService::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
+ @user_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new UserService REST client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Ads::AdManager::V1::UserService::Rest::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Ads::AdManager::V1::UserService::Rest::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the UserService 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
+ @user_service_stub = ::Google::Ads::AdManager::V1::UserService::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
+ @user_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
+ @user_service_stub.logger
175
+ end
176
+
177
+ # Service calls
178
+
179
+ ##
180
+ # API to retrieve a User object.
181
+ #
182
+ # To get the current user, the resource name
183
+ # `networks/{networkCode}/users/me` can be used.
184
+ #
185
+ # @overload get_user(request, options = nil)
186
+ # Pass arguments to `get_user` via a request object, either of type
187
+ # {::Google::Ads::AdManager::V1::GetUserRequest} or an equivalent Hash.
188
+ #
189
+ # @param request [::Google::Ads::AdManager::V1::GetUserRequest, ::Hash]
190
+ # A request object representing the call parameters. Required. To specify no
191
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
192
+ # @param options [::Gapic::CallOptions, ::Hash]
193
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
194
+ #
195
+ # @overload get_user(name: nil)
196
+ # Pass arguments to `get_user` via keyword arguments. Note that at
197
+ # least one keyword argument is required. To specify no parameters, or to keep all
198
+ # the default parameter values, pass an empty Hash as a request object (see above).
199
+ #
200
+ # @param name [::String]
201
+ # Required. The resource name of the User.
202
+ # Format: `networks/{network_code}/users/{user_id}`
203
+ # @yield [result, operation] Access the result along with the TransportOperation object
204
+ # @yieldparam result [::Google::Ads::AdManager::V1::User]
205
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
206
+ #
207
+ # @return [::Google::Ads::AdManager::V1::User]
208
+ #
209
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
210
+ #
211
+ # @example Basic example
212
+ # require "google/ads/ad_manager/v1"
213
+ #
214
+ # # Create a client object. The client can be reused for multiple calls.
215
+ # client = Google::Ads::AdManager::V1::UserService::Rest::Client.new
216
+ #
217
+ # # Create a request. To set request fields, pass in keyword arguments.
218
+ # request = Google::Ads::AdManager::V1::GetUserRequest.new
219
+ #
220
+ # # Call the get_user method.
221
+ # result = client.get_user request
222
+ #
223
+ # # The returned object is of type Google::Ads::AdManager::V1::User.
224
+ # p result
225
+ #
226
+ def get_user request, options = nil
227
+ raise ::ArgumentError, "request must be provided" if request.nil?
228
+
229
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::GetUserRequest
230
+
231
+ # Converts hash and nil to an options object
232
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
233
+
234
+ # Customize the options with defaults
235
+ call_metadata = @config.rpcs.get_user.metadata.to_h
236
+
237
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
238
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
239
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
240
+ gapic_version: ::Google::Ads::AdManager::V1::VERSION,
241
+ transports_version_send: [:rest]
242
+
243
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
244
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
245
+
246
+ options.apply_defaults timeout: @config.rpcs.get_user.timeout,
247
+ metadata: call_metadata,
248
+ retry_policy: @config.rpcs.get_user.retry_policy
249
+
250
+ options.apply_defaults timeout: @config.timeout,
251
+ metadata: @config.metadata,
252
+ retry_policy: @config.retry_policy
253
+
254
+ @user_service_stub.get_user request, options do |result, operation|
255
+ yield result, operation if block_given?
256
+ end
257
+ rescue ::Gapic::Rest::Error => e
258
+ raise ::Google::Cloud::Error.from_error(e)
259
+ end
260
+
261
+ ##
262
+ # Configuration class for the UserService REST API.
263
+ #
264
+ # This class represents the configuration for UserService REST,
265
+ # providing control over timeouts, retry behavior, logging, transport
266
+ # parameters, and other low-level controls. Certain parameters can also be
267
+ # applied individually to specific RPCs. See
268
+ # {::Google::Ads::AdManager::V1::UserService::Rest::Client::Configuration::Rpcs}
269
+ # for a list of RPCs that can be configured independently.
270
+ #
271
+ # Configuration can be applied globally to all clients, or to a single client
272
+ # on construction.
273
+ #
274
+ # @example
275
+ #
276
+ # # Modify the global config, setting the timeout for
277
+ # # get_user to 20 seconds,
278
+ # # and all remaining timeouts to 10 seconds.
279
+ # ::Google::Ads::AdManager::V1::UserService::Rest::Client.configure do |config|
280
+ # config.timeout = 10.0
281
+ # config.rpcs.get_user.timeout = 20.0
282
+ # end
283
+ #
284
+ # # Apply the above configuration only to a new client.
285
+ # client = ::Google::Ads::AdManager::V1::UserService::Rest::Client.new do |config|
286
+ # config.timeout = 10.0
287
+ # config.rpcs.get_user.timeout = 20.0
288
+ # end
289
+ #
290
+ # @!attribute [rw] endpoint
291
+ # A custom service endpoint, as a hostname or hostname:port. The default is
292
+ # nil, indicating to use the default endpoint in the current universe domain.
293
+ # @return [::String,nil]
294
+ # @!attribute [rw] credentials
295
+ # Credentials to send with calls. You may provide any of the following types:
296
+ # * (`String`) The path to a service account key file in JSON format
297
+ # * (`Hash`) A service account key as a Hash
298
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
299
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
300
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
301
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
302
+ # * (`nil`) indicating no credentials
303
+ # @return [::Object]
304
+ # @!attribute [rw] scope
305
+ # The OAuth scopes
306
+ # @return [::Array<::String>]
307
+ # @!attribute [rw] lib_name
308
+ # The library name as recorded in instrumentation and logging
309
+ # @return [::String]
310
+ # @!attribute [rw] lib_version
311
+ # The library version as recorded in instrumentation and logging
312
+ # @return [::String]
313
+ # @!attribute [rw] timeout
314
+ # The call timeout in seconds.
315
+ # @return [::Numeric]
316
+ # @!attribute [rw] metadata
317
+ # Additional headers to be sent with the call.
318
+ # @return [::Hash{::Symbol=>::String}]
319
+ # @!attribute [rw] retry_policy
320
+ # The retry policy. The value is a hash with the following keys:
321
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
322
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
323
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
324
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
325
+ # trigger a retry.
326
+ # @return [::Hash]
327
+ # @!attribute [rw] quota_project
328
+ # A separate project against which to charge quota.
329
+ # @return [::String]
330
+ # @!attribute [rw] universe_domain
331
+ # The universe domain within which to make requests. This determines the
332
+ # default endpoint URL. The default value of nil uses the environment
333
+ # universe (usually the default "googleapis.com" universe).
334
+ # @return [::String,nil]
335
+ # @!attribute [rw] logger
336
+ # A custom logger to use for request/response debug logging, or the value
337
+ # `:default` (the default) to construct a default logger, or `nil` to
338
+ # explicitly disable logging.
339
+ # @return [::Logger,:default,nil]
340
+ #
341
+ class Configuration
342
+ extend ::Gapic::Config
343
+
344
+ # @private
345
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
346
+ DEFAULT_ENDPOINT = "admanager.googleapis.com"
347
+
348
+ config_attr :endpoint, nil, ::String, nil
349
+ config_attr :credentials, nil do |value|
350
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
351
+ allowed.any? { |klass| klass === value }
352
+ end
353
+ config_attr :scope, nil, ::String, ::Array, nil
354
+ config_attr :lib_name, nil, ::String, nil
355
+ config_attr :lib_version, nil, ::String, nil
356
+ config_attr :timeout, nil, ::Numeric, nil
357
+ config_attr :metadata, nil, ::Hash, nil
358
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
359
+ config_attr :quota_project, nil, ::String, nil
360
+ config_attr :universe_domain, nil, ::String, nil
361
+ config_attr :logger, :default, ::Logger, nil, :default
362
+
363
+ # @private
364
+ def initialize parent_config = nil
365
+ @parent_config = parent_config unless parent_config.nil?
366
+
367
+ yield self if block_given?
368
+ end
369
+
370
+ ##
371
+ # Configurations for individual RPCs
372
+ # @return [Rpcs]
373
+ #
374
+ def rpcs
375
+ @rpcs ||= begin
376
+ parent_rpcs = nil
377
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
378
+ Rpcs.new parent_rpcs
379
+ end
380
+ end
381
+
382
+ ##
383
+ # Configuration RPC class for the UserService API.
384
+ #
385
+ # Includes fields providing the configuration for each RPC in this service.
386
+ # Each configuration object is of type `Gapic::Config::Method` and includes
387
+ # the following configuration fields:
388
+ #
389
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
390
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
391
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
392
+ # include the following keys:
393
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
394
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
395
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
396
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
397
+ # trigger a retry.
398
+ #
399
+ class Rpcs
400
+ ##
401
+ # RPC-specific configuration for `get_user`
402
+ # @return [::Gapic::Config::Method]
403
+ #
404
+ attr_reader :get_user
405
+
406
+ # @private
407
+ def initialize parent_rpcs = nil
408
+ get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user
409
+ @get_user = ::Gapic::Config::Method.new get_user_config
410
+
411
+ yield self if block_given?
412
+ end
413
+ end
414
+ end
415
+ end
416
+ end
417
+ end
418
+ end
419
+ end
420
+ end
421
+ end
@@ -0,0 +1,142 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/ads/admanager/v1/user_service_pb"
20
+
21
+ module Google
22
+ module Ads
23
+ module AdManager
24
+ module V1
25
+ module UserService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the UserService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: true,
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
47
+ end
48
+
49
+ ##
50
+ # The effective universe domain
51
+ #
52
+ # @return [String]
53
+ #
54
+ def universe_domain
55
+ @client_stub.universe_domain
56
+ end
57
+
58
+ ##
59
+ # The effective endpoint
60
+ #
61
+ # @return [String]
62
+ #
63
+ def endpoint
64
+ @client_stub.endpoint
65
+ end
66
+
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
76
+ ##
77
+ # Baseline implementation for the get_user REST call
78
+ #
79
+ # @param request_pb [::Google::Ads::AdManager::V1::GetUserRequest]
80
+ # A request object representing the call parameters. Required.
81
+ # @param options [::Gapic::CallOptions]
82
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
83
+ #
84
+ # @yield [result, operation] Access the result along with the TransportOperation object
85
+ # @yieldparam result [::Google::Ads::AdManager::V1::User]
86
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
87
+ #
88
+ # @return [::Google::Ads::AdManager::V1::User]
89
+ # A result object deserialized from the server's reply
90
+ def get_user request_pb, options = nil
91
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
92
+
93
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_user_request request_pb
94
+ query_string_params = if query_string_params.any?
95
+ query_string_params.to_h { |p| p.split "=", 2 }
96
+ else
97
+ {}
98
+ end
99
+
100
+ response = @client_stub.make_http_request(
101
+ verb,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "get_user",
106
+ options: options
107
+ )
108
+ operation = ::Gapic::Rest::TransportOperation.new response
109
+ result = ::Google::Ads::AdManager::V1::User.decode_json response.body, ignore_unknown_fields: true
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
114
+ end
115
+
116
+ ##
117
+ # @private
118
+ #
119
+ # GRPC transcoding helper method for the get_user REST call
120
+ #
121
+ # @param request_pb [::Google::Ads::AdManager::V1::GetUserRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def self.transcode_get_user_request request_pb
126
+ transcoder = Gapic::Rest::GrpcTranscoder.new
127
+ .with_bindings(
128
+ uri_method: :get,
129
+ uri_template: "/v1/{name}",
130
+ matches: [
131
+ ["name", %r{^networks/[^/]+/users/[^/]+/?$}, false]
132
+ ]
133
+ )
134
+ transcoder.transcode request_pb
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/ads/ad_manager/v1/version"
24
+
25
+ require "google/ads/ad_manager/v1/user_service/credentials"
26
+ require "google/ads/ad_manager/v1/user_service/paths"
27
+ require "google/ads/ad_manager/v1/user_service/rest/client"
28
+
29
+ module Google
30
+ module Ads
31
+ module AdManager
32
+ module V1
33
+ ##
34
+ # Provides methods for handling User objects.
35
+ #
36
+ # To load this service and instantiate a REST client:
37
+ #
38
+ # require "google/ads/ad_manager/v1/user_service/rest"
39
+ # client = ::Google::Ads::AdManager::V1::UserService::Rest::Client.new
40
+ #
41
+ module UserService
42
+ # Client for the REST transport
43
+ module Rest
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
52
+ require "google/ads/ad_manager/v1/user_service/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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 "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/ads/ad_manager/v1/version"
23
+
24
+ require "google/ads/ad_manager/v1/user_service/credentials"
25
+ require "google/ads/ad_manager/v1/user_service/paths"
26
+ require "google/ads/ad_manager/v1/user_service/rest"
27
+
28
+ module Google
29
+ module Ads
30
+ module AdManager
31
+ module V1
32
+ ##
33
+ # Provides methods for handling User objects.
34
+ #
35
+ # @example Load this service and instantiate a REST client
36
+ #
37
+ # require "google/ads/ad_manager/v1/user_service/rest"
38
+ # client = ::Google::Ads::AdManager::V1::UserService::Rest::Client.new
39
+ #
40
+ module UserService
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ helper_path = ::File.join __dir__, "user_service", "helpers.rb"
48
+ require "google/ads/ad_manager/v1/user_service/helpers" if ::File.file? helper_path