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.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +154 -8
- data/lib/google/ads/ad_manager/v1/ad_unit_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/ad_unit_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/client.rb +644 -0
- data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/service_stub.rb +264 -0
- data/lib/google/ads/ad_manager/v1/ad_unit_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/ad_unit_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/company_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/company_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/company_service/rest/client.rb +531 -0
- data/lib/google/ads/ad_manager/v1/company_service/rest/service_stub.rb +203 -0
- data/lib/google/ads/ad_manager/v1/company_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/company_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/custom_field_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/custom_field_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/custom_field_service/rest/client.rb +531 -0
- data/lib/google/ads/ad_manager/v1/custom_field_service/rest/service_stub.rb +203 -0
- data/lib/google/ads/ad_manager/v1/custom_field_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/custom_field_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/client.rb +532 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/service_stub.rb +203 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_key_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/paths.rb +69 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/client.rb +535 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/service_stub.rb +203 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/custom_targeting_value_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/client.rb +894 -0
- data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/service_stub.rb +451 -0
- data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/network_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/network_service/paths.rb +47 -0
- data/lib/google/ads/ad_manager/v1/network_service/rest/client.rb +495 -0
- data/lib/google/ads/ad_manager/v1/network_service/rest/service_stub.rb +201 -0
- data/lib/google/ads/ad_manager/v1/network_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/network_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/order_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/order_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/order_service/rest/client.rb +541 -0
- data/lib/google/ads/ad_manager/v1/order_service/rest/service_stub.rb +203 -0
- data/lib/google/ads/ad_manager/v1/order_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/order_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/placement_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/placement_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/placement_service/rest/client.rb +531 -0
- data/lib/google/ads/ad_manager/v1/placement_service/rest/service_stub.rb +203 -0
- data/lib/google/ads/ad_manager/v1/placement_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/placement_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/report_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/report_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/report_service/rest/client.rb +923 -0
- data/lib/google/ads/ad_manager/v1/report_service/rest/operations.rb +914 -0
- data/lib/google/ads/ad_manager/v1/report_service/rest/service_stub.rb +450 -0
- data/lib/google/ads/ad_manager/v1/report_service/rest.rb +53 -0
- data/lib/google/ads/ad_manager/v1/report_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/rest.rb +49 -0
- data/lib/google/ads/ad_manager/v1/role_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/role_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/role_service/rest/client.rb +530 -0
- data/lib/google/ads/ad_manager/v1/role_service/rest/service_stub.rb +203 -0
- data/lib/google/ads/ad_manager/v1/role_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/role_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/taxonomy_category_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/taxonomy_category_service/paths.rb +64 -0
- data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/client.rb +531 -0
- data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/service_stub.rb +203 -0
- data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/taxonomy_category_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/user_service/credentials.rb +44 -0
- data/lib/google/ads/ad_manager/v1/user_service/paths.rb +50 -0
- data/lib/google/ads/ad_manager/v1/user_service/rest/client.rb +421 -0
- data/lib/google/ads/ad_manager/v1/user_service/rest/service_stub.rb +142 -0
- data/lib/google/ads/ad_manager/v1/user_service/rest.rb +52 -0
- data/lib/google/ads/ad_manager/v1/user_service.rb +48 -0
- data/lib/google/ads/ad_manager/v1/version.rb +7 -2
- data/lib/google/ads/ad_manager/v1.rb +52 -0
- data/lib/google/ads/admanager/v1/ad_unit_enums_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/ad_unit_messages_pb.rb +60 -0
- data/lib/google/ads/admanager/v1/ad_unit_service_pb.rb +53 -0
- data/lib/google/ads/admanager/v1/ad_unit_service_services_pb.rb +49 -0
- data/lib/google/ads/admanager/v1/admanager_error_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/applied_label_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/company_credit_status_enum_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/company_messages_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/company_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/company_service_services_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/company_type_enum_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/contact_messages_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/custom_field_enums_pb.rb +49 -0
- data/lib/google/ads/admanager/v1/custom_field_messages_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/custom_field_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/custom_field_service_services_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/custom_field_value_pb.rb +46 -0
- data/lib/google/ads/admanager/v1/custom_targeting_key_enums_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/custom_targeting_key_messages_pb.rb +46 -0
- data/lib/google/ads/admanager/v1/custom_targeting_key_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/custom_targeting_key_service_services_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/custom_targeting_value_enums_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/custom_targeting_value_messages_pb.rb +46 -0
- data/lib/google/ads/admanager/v1/custom_targeting_value_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/custom_targeting_value_service_services_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/entity_signals_mapping_messages_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/entity_signals_mapping_service_pb.rb +59 -0
- data/lib/google/ads/admanager/v1/entity_signals_mapping_service_services_pb.rb +55 -0
- data/lib/google/ads/admanager/v1/environment_type_enum_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/frequency_cap_pb.rb +44 -0
- data/lib/google/ads/admanager/v1/label_messages_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/network_messages_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/network_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/network_service_services_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/order_enums_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/order_messages_pb.rb +52 -0
- data/lib/google/ads/admanager/v1/order_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/order_service_services_pb.rb +52 -0
- data/lib/google/ads/admanager/v1/placement_enums_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/placement_messages_pb.rb +48 -0
- data/lib/google/ads/admanager/v1/placement_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/placement_service_services_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/report_service_pb.rb +97 -0
- data/lib/google/ads/admanager/v1/report_service_services_pb.rb +65 -0
- data/lib/google/ads/admanager/v1/role_enums_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/role_messages_pb.rb +46 -0
- data/lib/google/ads/admanager/v1/role_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/role_service_services_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/size_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/size_type_enum_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/taxonomy_category_messages_pb.rb +46 -0
- data/lib/google/ads/admanager/v1/taxonomy_category_service_pb.rb +51 -0
- data/lib/google/ads/admanager/v1/taxonomy_category_service_services_pb.rb +47 -0
- data/lib/google/ads/admanager/v1/taxonomy_type_enum_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/team_messages_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/time_unit_enum_pb.rb +43 -0
- data/lib/google/ads/admanager/v1/user_messages_pb.rb +45 -0
- data/lib/google/ads/admanager/v1/user_service_pb.rb +48 -0
- data/lib/google/ads/admanager/v1/user_service_services_pb.rb +48 -0
- data/lib/google-ads-ad_manager-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/ads/admanager/v1/ad_unit_enums.rb +91 -0
- data/proto_docs/google/ads/admanager/v1/ad_unit_messages.rb +188 -0
- data/proto_docs/google/ads/admanager/v1/ad_unit_service.rb +160 -0
- data/proto_docs/google/ads/admanager/v1/admanager_error.rb +54 -0
- data/proto_docs/google/ads/admanager/v1/applied_label.rb +39 -0
- data/proto_docs/google/ads/admanager/v1/company_credit_status_enum.rb +101 -0
- data/proto_docs/google/ads/admanager/v1/company_messages.rb +101 -0
- data/proto_docs/google/ads/admanager/v1/company_service.rb +99 -0
- data/proto_docs/google/ads/admanager/v1/company_type_enum.rb +55 -0
- data/proto_docs/google/ads/admanager/v1/contact_messages.rb +43 -0
- data/proto_docs/google/ads/admanager/v1/custom_field_enums.rb +123 -0
- data/proto_docs/google/ads/admanager/v1/custom_field_messages.rb +78 -0
- data/proto_docs/google/ads/admanager/v1/custom_field_service.rb +99 -0
- data/proto_docs/google/ads/admanager/v1/custom_field_value.rb +58 -0
- data/proto_docs/google/ads/admanager/v1/custom_targeting_key_enums.rb +86 -0
- data/proto_docs/google/ads/admanager/v1/custom_targeting_key_messages.rb +59 -0
- data/proto_docs/google/ads/admanager/v1/custom_targeting_key_service.rb +100 -0
- data/proto_docs/google/ads/admanager/v1/custom_targeting_value_enums.rb +97 -0
- data/proto_docs/google/ads/admanager/v1/custom_targeting_value_messages.rb +54 -0
- data/proto_docs/google/ads/admanager/v1/custom_targeting_value_service.rb +103 -0
- data/proto_docs/google/ads/admanager/v1/entity_signals_mapping_messages.rb +53 -0
- data/proto_docs/google/ads/admanager/v1/entity_signals_mapping_service.rb +180 -0
- data/proto_docs/google/ads/admanager/v1/environment_type_enum.rb +45 -0
- data/proto_docs/google/ads/admanager/v1/frequency_cap.rb +41 -0
- data/proto_docs/google/ads/admanager/v1/label_messages.rb +36 -0
- data/proto_docs/google/ads/admanager/v1/network_messages.rb +67 -0
- data/proto_docs/google/ads/admanager/v1/network_service.rb +51 -0
- data/proto_docs/google/ads/admanager/v1/order_enums.rb +63 -0
- data/proto_docs/google/ads/admanager/v1/order_messages.rb +149 -0
- data/proto_docs/google/ads/admanager/v1/order_service.rb +99 -0
- data/proto_docs/google/ads/admanager/v1/placement_enums.rb +48 -0
- data/proto_docs/google/ads/admanager/v1/placement_messages.rb +62 -0
- data/proto_docs/google/ads/admanager/v1/placement_service.rb +99 -0
- data/proto_docs/google/ads/admanager/v1/report_service.rb +3476 -0
- data/proto_docs/google/ads/admanager/v1/role_enums.rb +45 -0
- data/proto_docs/google/ads/admanager/v1/role_messages.rb +51 -0
- data/proto_docs/google/ads/admanager/v1/role_service.rb +97 -0
- data/proto_docs/google/ads/admanager/v1/size.rb +48 -0
- data/proto_docs/google/ads/admanager/v1/size_type_enum.rb +66 -0
- data/proto_docs/google/ads/admanager/v1/taxonomy_category_messages.rb +59 -0
- data/proto_docs/google/ads/admanager/v1/taxonomy_category_service.rb +99 -0
- data/proto_docs/google/ads/admanager/v1/taxonomy_type_enum.rb +55 -0
- data/proto_docs/google/ads/admanager/v1/team_messages.rb +40 -0
- data/proto_docs/google/ads/admanager/v1/time_unit_enum.rb +63 -0
- data/proto_docs/google/ads/admanager/v1/user_messages.rb +69 -0
- data/proto_docs/google/ads/admanager/v1/user_service.rb +36 -0
- data/proto_docs/google/api/client.rb +459 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +227 -0
- data/proto_docs/google/longrunning/operations.rb +169 -0
- data/proto_docs/google/protobuf/any.rb +145 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- data/proto_docs/google/type/date.rb +53 -0
- data/proto_docs/google/type/dayofweek.rb +49 -0
- data/proto_docs/google/type/timeofday.rb +45 -0
- metadata +248 -11
@@ -0,0 +1,64 @@
|
|
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
|
+
|
20
|
+
module Google
|
21
|
+
module Ads
|
22
|
+
module AdManager
|
23
|
+
module V1
|
24
|
+
module RoleService
|
25
|
+
# Path helper methods for the RoleService API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Network resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `networks/{network_code}`
|
33
|
+
#
|
34
|
+
# @param network_code [String]
|
35
|
+
#
|
36
|
+
# @return [::String]
|
37
|
+
def network_path network_code:
|
38
|
+
"networks/#{network_code}"
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Create a fully-qualified Role resource string.
|
43
|
+
#
|
44
|
+
# The resource will be in the following format:
|
45
|
+
#
|
46
|
+
# `networks/{network_code}/roles/{role}`
|
47
|
+
#
|
48
|
+
# @param network_code [String]
|
49
|
+
# @param role [String]
|
50
|
+
#
|
51
|
+
# @return [::String]
|
52
|
+
def role_path network_code:, role:
|
53
|
+
raise ::ArgumentError, "network_code cannot contain /" if network_code.to_s.include? "/"
|
54
|
+
|
55
|
+
"networks/#{network_code}/roles/#{role}"
|
56
|
+
end
|
57
|
+
|
58
|
+
extend self
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,530 @@
|
|
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/role_service_pb"
|
21
|
+
require "google/ads/ad_manager/v1/role_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Ads
|
25
|
+
module AdManager
|
26
|
+
module V1
|
27
|
+
module RoleService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the RoleService service.
|
31
|
+
#
|
32
|
+
# Provides methods for handling `Role` 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 :role_service_stub
|
45
|
+
|
46
|
+
##
|
47
|
+
# Configure the RoleService Client class.
|
48
|
+
#
|
49
|
+
# See {::Google::Ads::AdManager::V1::RoleService::Rest::Client::Configuration}
|
50
|
+
# for a description of the configuration fields.
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
#
|
54
|
+
# # Modify the configuration for all RoleService clients
|
55
|
+
# ::Google::Ads::AdManager::V1::RoleService::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 RoleService 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::RoleService::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
|
+
@role_service_stub.universe_domain
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# Create a new RoleService REST client object.
|
112
|
+
#
|
113
|
+
# @example
|
114
|
+
#
|
115
|
+
# # Create a client using the default configuration
|
116
|
+
# client = ::Google::Ads::AdManager::V1::RoleService::Rest::Client.new
|
117
|
+
#
|
118
|
+
# # Create a client using a custom configuration
|
119
|
+
# client = ::Google::Ads::AdManager::V1::RoleService::Rest::Client.new do |config|
|
120
|
+
# config.timeout = 10.0
|
121
|
+
# end
|
122
|
+
#
|
123
|
+
# @yield [config] Configure the RoleService 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
|
+
@role_service_stub = ::Google::Ads::AdManager::V1::RoleService::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
|
+
@role_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
|
+
@role_service_stub.logger
|
175
|
+
end
|
176
|
+
|
177
|
+
# Service calls
|
178
|
+
|
179
|
+
##
|
180
|
+
# API to retrieve a `Role` object.
|
181
|
+
#
|
182
|
+
# @overload get_role(request, options = nil)
|
183
|
+
# Pass arguments to `get_role` via a request object, either of type
|
184
|
+
# {::Google::Ads::AdManager::V1::GetRoleRequest} or an equivalent Hash.
|
185
|
+
#
|
186
|
+
# @param request [::Google::Ads::AdManager::V1::GetRoleRequest, ::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_role(name: nil)
|
193
|
+
# Pass arguments to `get_role` 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 Role.
|
199
|
+
# Format: `networks/{network_code}/roles/{role_id}`
|
200
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
201
|
+
# @yieldparam result [::Google::Ads::AdManager::V1::Role]
|
202
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
203
|
+
#
|
204
|
+
# @return [::Google::Ads::AdManager::V1::Role]
|
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::RoleService::Rest::Client.new
|
213
|
+
#
|
214
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
215
|
+
# request = Google::Ads::AdManager::V1::GetRoleRequest.new
|
216
|
+
#
|
217
|
+
# # Call the get_role method.
|
218
|
+
# result = client.get_role request
|
219
|
+
#
|
220
|
+
# # The returned object is of type Google::Ads::AdManager::V1::Role.
|
221
|
+
# p result
|
222
|
+
#
|
223
|
+
def get_role 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::GetRoleRequest
|
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_role.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_role.timeout,
|
244
|
+
metadata: call_metadata,
|
245
|
+
retry_policy: @config.rpcs.get_role.retry_policy
|
246
|
+
|
247
|
+
options.apply_defaults timeout: @config.timeout,
|
248
|
+
metadata: @config.metadata,
|
249
|
+
retry_policy: @config.retry_policy
|
250
|
+
|
251
|
+
@role_service_stub.get_role 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
|
+
# API to retrieve a list of `Role` objects.
|
260
|
+
#
|
261
|
+
# @overload list_roles(request, options = nil)
|
262
|
+
# Pass arguments to `list_roles` via a request object, either of type
|
263
|
+
# {::Google::Ads::AdManager::V1::ListRolesRequest} or an equivalent Hash.
|
264
|
+
#
|
265
|
+
# @param request [::Google::Ads::AdManager::V1::ListRolesRequest, ::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_roles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, skip: nil)
|
272
|
+
# Pass arguments to `list_roles` 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 Roles.
|
278
|
+
# Format: `networks/{network_code}`
|
279
|
+
# @param page_size [::Integer]
|
280
|
+
# Optional. The maximum number of `Roles` to return. The service may return
|
281
|
+
# fewer than this value. If unspecified, at most 50 `Roles` will be returned.
|
282
|
+
# The maximum value is 1000; values above 1000 will be coerced to 1000.
|
283
|
+
# @param page_token [::String]
|
284
|
+
# Optional. A page token, received from a previous `ListRoles` call.
|
285
|
+
# Provide this to retrieve the subsequent page.
|
286
|
+
#
|
287
|
+
# When paginating, all other parameters provided to `ListRoles` must match
|
288
|
+
# the call that provided the page token.
|
289
|
+
# @param filter [::String]
|
290
|
+
# Optional. Expression to filter the response.
|
291
|
+
# See syntax details at
|
292
|
+
# https://developers.google.com/ad-manager/api/beta/filters
|
293
|
+
# @param order_by [::String]
|
294
|
+
# Optional. Expression to specify sorting order.
|
295
|
+
# See syntax details at
|
296
|
+
# https://developers.google.com/ad-manager/api/beta/filters#order
|
297
|
+
# @param skip [::Integer]
|
298
|
+
# Optional. Number of individual resources to skip while paginating.
|
299
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
300
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::Role>]
|
301
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
302
|
+
#
|
303
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::Role>]
|
304
|
+
#
|
305
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
306
|
+
#
|
307
|
+
# @example Basic example
|
308
|
+
# require "google/ads/ad_manager/v1"
|
309
|
+
#
|
310
|
+
# # Create a client object. The client can be reused for multiple calls.
|
311
|
+
# client = Google::Ads::AdManager::V1::RoleService::Rest::Client.new
|
312
|
+
#
|
313
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
314
|
+
# request = Google::Ads::AdManager::V1::ListRolesRequest.new
|
315
|
+
#
|
316
|
+
# # Call the list_roles method.
|
317
|
+
# result = client.list_roles request
|
318
|
+
#
|
319
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
320
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
321
|
+
# result.each do |item|
|
322
|
+
# # Each element is of type ::Google::Ads::AdManager::V1::Role.
|
323
|
+
# p item
|
324
|
+
# end
|
325
|
+
#
|
326
|
+
def list_roles request, options = nil
|
327
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
328
|
+
|
329
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::ListRolesRequest
|
330
|
+
|
331
|
+
# Converts hash and nil to an options object
|
332
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
333
|
+
|
334
|
+
# Customize the options with defaults
|
335
|
+
call_metadata = @config.rpcs.list_roles.metadata.to_h
|
336
|
+
|
337
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
338
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
339
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
340
|
+
gapic_version: ::Google::Ads::AdManager::V1::VERSION,
|
341
|
+
transports_version_send: [:rest]
|
342
|
+
|
343
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
344
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
345
|
+
|
346
|
+
options.apply_defaults timeout: @config.rpcs.list_roles.timeout,
|
347
|
+
metadata: call_metadata,
|
348
|
+
retry_policy: @config.rpcs.list_roles.retry_policy
|
349
|
+
|
350
|
+
options.apply_defaults timeout: @config.timeout,
|
351
|
+
metadata: @config.metadata,
|
352
|
+
retry_policy: @config.retry_policy
|
353
|
+
|
354
|
+
@role_service_stub.list_roles request, options do |result, operation|
|
355
|
+
result = ::Gapic::Rest::PagedEnumerable.new @role_service_stub, :list_roles, "roles", request, result, options
|
356
|
+
yield result, operation if block_given?
|
357
|
+
throw :response, result
|
358
|
+
end
|
359
|
+
rescue ::Gapic::Rest::Error => e
|
360
|
+
raise ::Google::Cloud::Error.from_error(e)
|
361
|
+
end
|
362
|
+
|
363
|
+
##
|
364
|
+
# Configuration class for the RoleService REST API.
|
365
|
+
#
|
366
|
+
# This class represents the configuration for RoleService REST,
|
367
|
+
# providing control over timeouts, retry behavior, logging, transport
|
368
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
369
|
+
# applied individually to specific RPCs. See
|
370
|
+
# {::Google::Ads::AdManager::V1::RoleService::Rest::Client::Configuration::Rpcs}
|
371
|
+
# for a list of RPCs that can be configured independently.
|
372
|
+
#
|
373
|
+
# Configuration can be applied globally to all clients, or to a single client
|
374
|
+
# on construction.
|
375
|
+
#
|
376
|
+
# @example
|
377
|
+
#
|
378
|
+
# # Modify the global config, setting the timeout for
|
379
|
+
# # get_role to 20 seconds,
|
380
|
+
# # and all remaining timeouts to 10 seconds.
|
381
|
+
# ::Google::Ads::AdManager::V1::RoleService::Rest::Client.configure do |config|
|
382
|
+
# config.timeout = 10.0
|
383
|
+
# config.rpcs.get_role.timeout = 20.0
|
384
|
+
# end
|
385
|
+
#
|
386
|
+
# # Apply the above configuration only to a new client.
|
387
|
+
# client = ::Google::Ads::AdManager::V1::RoleService::Rest::Client.new do |config|
|
388
|
+
# config.timeout = 10.0
|
389
|
+
# config.rpcs.get_role.timeout = 20.0
|
390
|
+
# end
|
391
|
+
#
|
392
|
+
# @!attribute [rw] endpoint
|
393
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
394
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
395
|
+
# @return [::String,nil]
|
396
|
+
# @!attribute [rw] credentials
|
397
|
+
# Credentials to send with calls. You may provide any of the following types:
|
398
|
+
# * (`String`) The path to a service account key file in JSON format
|
399
|
+
# * (`Hash`) A service account key as a Hash
|
400
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
401
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
402
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
403
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
404
|
+
# * (`nil`) indicating no credentials
|
405
|
+
# @return [::Object]
|
406
|
+
# @!attribute [rw] scope
|
407
|
+
# The OAuth scopes
|
408
|
+
# @return [::Array<::String>]
|
409
|
+
# @!attribute [rw] lib_name
|
410
|
+
# The library name as recorded in instrumentation and logging
|
411
|
+
# @return [::String]
|
412
|
+
# @!attribute [rw] lib_version
|
413
|
+
# The library version as recorded in instrumentation and logging
|
414
|
+
# @return [::String]
|
415
|
+
# @!attribute [rw] timeout
|
416
|
+
# The call timeout in seconds.
|
417
|
+
# @return [::Numeric]
|
418
|
+
# @!attribute [rw] metadata
|
419
|
+
# Additional headers to be sent with the call.
|
420
|
+
# @return [::Hash{::Symbol=>::String}]
|
421
|
+
# @!attribute [rw] retry_policy
|
422
|
+
# The retry policy. The value is a hash with the following keys:
|
423
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
424
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
425
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
426
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
427
|
+
# trigger a retry.
|
428
|
+
# @return [::Hash]
|
429
|
+
# @!attribute [rw] quota_project
|
430
|
+
# A separate project against which to charge quota.
|
431
|
+
# @return [::String]
|
432
|
+
# @!attribute [rw] universe_domain
|
433
|
+
# The universe domain within which to make requests. This determines the
|
434
|
+
# default endpoint URL. The default value of nil uses the environment
|
435
|
+
# universe (usually the default "googleapis.com" universe).
|
436
|
+
# @return [::String,nil]
|
437
|
+
# @!attribute [rw] logger
|
438
|
+
# A custom logger to use for request/response debug logging, or the value
|
439
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
440
|
+
# explicitly disable logging.
|
441
|
+
# @return [::Logger,:default,nil]
|
442
|
+
#
|
443
|
+
class Configuration
|
444
|
+
extend ::Gapic::Config
|
445
|
+
|
446
|
+
# @private
|
447
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
448
|
+
DEFAULT_ENDPOINT = "admanager.googleapis.com"
|
449
|
+
|
450
|
+
config_attr :endpoint, nil, ::String, nil
|
451
|
+
config_attr :credentials, nil do |value|
|
452
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
453
|
+
allowed.any? { |klass| klass === value }
|
454
|
+
end
|
455
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
456
|
+
config_attr :lib_name, nil, ::String, nil
|
457
|
+
config_attr :lib_version, nil, ::String, nil
|
458
|
+
config_attr :timeout, nil, ::Numeric, nil
|
459
|
+
config_attr :metadata, nil, ::Hash, nil
|
460
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
461
|
+
config_attr :quota_project, nil, ::String, nil
|
462
|
+
config_attr :universe_domain, nil, ::String, nil
|
463
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
464
|
+
|
465
|
+
# @private
|
466
|
+
def initialize parent_config = nil
|
467
|
+
@parent_config = parent_config unless parent_config.nil?
|
468
|
+
|
469
|
+
yield self if block_given?
|
470
|
+
end
|
471
|
+
|
472
|
+
##
|
473
|
+
# Configurations for individual RPCs
|
474
|
+
# @return [Rpcs]
|
475
|
+
#
|
476
|
+
def rpcs
|
477
|
+
@rpcs ||= begin
|
478
|
+
parent_rpcs = nil
|
479
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
480
|
+
Rpcs.new parent_rpcs
|
481
|
+
end
|
482
|
+
end
|
483
|
+
|
484
|
+
##
|
485
|
+
# Configuration RPC class for the RoleService API.
|
486
|
+
#
|
487
|
+
# Includes fields providing the configuration for each RPC in this service.
|
488
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
489
|
+
# the following configuration fields:
|
490
|
+
#
|
491
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
492
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
493
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
494
|
+
# include the following keys:
|
495
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
496
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
497
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
498
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
499
|
+
# trigger a retry.
|
500
|
+
#
|
501
|
+
class Rpcs
|
502
|
+
##
|
503
|
+
# RPC-specific configuration for `get_role`
|
504
|
+
# @return [::Gapic::Config::Method]
|
505
|
+
#
|
506
|
+
attr_reader :get_role
|
507
|
+
##
|
508
|
+
# RPC-specific configuration for `list_roles`
|
509
|
+
# @return [::Gapic::Config::Method]
|
510
|
+
#
|
511
|
+
attr_reader :list_roles
|
512
|
+
|
513
|
+
# @private
|
514
|
+
def initialize parent_rpcs = nil
|
515
|
+
get_role_config = parent_rpcs.get_role if parent_rpcs.respond_to? :get_role
|
516
|
+
@get_role = ::Gapic::Config::Method.new get_role_config
|
517
|
+
list_roles_config = parent_rpcs.list_roles if parent_rpcs.respond_to? :list_roles
|
518
|
+
@list_roles = ::Gapic::Config::Method.new list_roles_config
|
519
|
+
|
520
|
+
yield self if block_given?
|
521
|
+
end
|
522
|
+
end
|
523
|
+
end
|
524
|
+
end
|
525
|
+
end
|
526
|
+
end
|
527
|
+
end
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|