google-shopping-merchant-accounts-v1beta 0.a → 0.1.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 +144 -8
- data/lib/google/shopping/merchant/accounts/v1beta/accessright_pb.rb +44 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/client.rb +452 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/client.rb +419 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/service_stub.rb +130 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_pb.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/client.rb +633 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/client.rb +586 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/service_stub.rb +249 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service.rb +61 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_services_pb.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accountissue_pb.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accountissue_services_pb.rb +47 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_pb.rb +67 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/client.rb +942 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/paths.rb +80 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/client.rb +890 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/service_stub.rb +423 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_services_pb.rb +71 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/client.rb +525 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/client.rb +485 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest.rb +55 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/client.rb +524 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/client.rb +484 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/businessidentity_pb.rb +56 -0
- data/lib/google/shopping/merchant/accounts/v1beta/businessidentity_services_pb.rb +51 -0
- data/lib/google/shopping/merchant/accounts/v1beta/businessinfo_pb.rb +60 -0
- data/lib/google/shopping/merchant/accounts/v1beta/businessinfo_services_pb.rb +50 -0
- data/lib/google/shopping/merchant/accounts/v1beta/customerservice_pb.rb +48 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/client.rb +539 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/paths.rb +52 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/client.rb +499 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service.rb +60 -0
- data/lib/google/shopping/merchant/accounts/v1beta/emailpreferences_pb.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/emailpreferences_services_pb.rb +65 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_pb.rb +55 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/client.rb +724 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/client.rb +670 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/service_stub.rb +310 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_services_pb.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_pb.rb +61 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/client.rb +551 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/client.rb +511 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/service_stub.rb +189 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service.rb +61 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_services_pb.rb +53 -0
- data/lib/google/shopping/merchant/accounts/v1beta/phoneverificationstate_pb.rb +44 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_pb.rb +56 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/client.rb +734 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/client.rb +680 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/service_stub.rb +309 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest.rb +64 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service.rb +67 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_services_pb.rb +65 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_pb.rb +63 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/client.rb +835 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/client.rb +774 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/service_stub.rb +368 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service.rb +61 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_services_pb.rb +62 -0
- data/lib/google/shopping/merchant/accounts/v1beta/rest.rb +52 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/client.rb +526 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/client.rb +486 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest.rb +55 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shippingsettings_pb.rb +83 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shippingsettings_services_pb.rb +51 -0
- data/lib/google/shopping/merchant/accounts/v1beta/tax_rule_pb.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/client.rb +522 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/client.rb +482 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/service_stub.rb +189 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/client.rb +623 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/paths.rb +63 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/client.rb +584 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/service_stub.rb +246 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofservice_pb.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofservice_services_pb.rb +52 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate_pb.rb +56 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate_services_pb.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofservicekind_pb.rb +44 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_pb.rb +60 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/client.rb +838 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/client.rb +777 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/service_stub.rb +368 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_services_pb.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/version.rb +7 -2
- data/lib/google/shopping/merchant/accounts/v1beta.rb +60 -0
- data/lib/google-shopping-merchant-accounts-v1beta.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +399 -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 +222 -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/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/accessright.rb +43 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/account_tax.rb +101 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/accountissue.rb +142 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/accounts.rb +219 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/businessidentity.rb +129 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/businessinfo.rb +72 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/customerservice.rb +43 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/emailpreferences.rb +82 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/homepage.rb +87 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/online_return_policy.rb +238 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/phoneverificationstate.rb +40 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/programs.rb +160 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/regions.rb +195 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/shippingsettings.rb +743 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/tax_rule.rb +88 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofservice.rb +99 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.rb +132 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofservicekind.rb +37 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/user.rb +156 -0
- data/proto_docs/google/shopping/type/types.rb +210 -0
- data/proto_docs/google/type/date.rb +53 -0
- data/proto_docs/google/type/datetime.rb +99 -0
- data/proto_docs/google/type/interval.rb +45 -0
- data/proto_docs/google/type/phone_number.rb +112 -0
- data/proto_docs/google/type/postal_address.rb +135 -0
- metadata +234 -10
@@ -0,0 +1,486 @@
|
|
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/shopping/merchant/accounts/v1beta/shippingsettings_pb"
|
21
|
+
require "google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Shopping
|
25
|
+
module Merchant
|
26
|
+
module Accounts
|
27
|
+
module V1beta
|
28
|
+
module ShippingSettingsService
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the ShippingSettingsService service.
|
32
|
+
#
|
33
|
+
# Service to get method call shipping setting information per Merchant API
|
34
|
+
# method.
|
35
|
+
#
|
36
|
+
class Client
|
37
|
+
# @private
|
38
|
+
API_VERSION = ""
|
39
|
+
|
40
|
+
# @private
|
41
|
+
DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
|
42
|
+
|
43
|
+
include Paths
|
44
|
+
|
45
|
+
# @private
|
46
|
+
attr_reader :shipping_settings_service_stub
|
47
|
+
|
48
|
+
##
|
49
|
+
# Configure the ShippingSettingsService Client class.
|
50
|
+
#
|
51
|
+
# See {::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client::Configuration}
|
52
|
+
# for a description of the configuration fields.
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
#
|
56
|
+
# # Modify the configuration for all ShippingSettingsService clients
|
57
|
+
# ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client.configure do |config|
|
58
|
+
# config.timeout = 10.0
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# @yield [config] Configure the Client client.
|
62
|
+
# @yieldparam config [Client::Configuration]
|
63
|
+
#
|
64
|
+
# @return [Client::Configuration]
|
65
|
+
#
|
66
|
+
def self.configure
|
67
|
+
@configure ||= begin
|
68
|
+
namespace = ["Google", "Shopping", "Merchant", "Accounts", "V1beta"]
|
69
|
+
parent_config = while namespace.any?
|
70
|
+
parent_name = namespace.join "::"
|
71
|
+
parent_const = const_get parent_name
|
72
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
73
|
+
namespace.pop
|
74
|
+
end
|
75
|
+
default_config = Client::Configuration.new parent_config
|
76
|
+
|
77
|
+
default_config
|
78
|
+
end
|
79
|
+
yield @configure if block_given?
|
80
|
+
@configure
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Configure the ShippingSettingsService Client instance.
|
85
|
+
#
|
86
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
87
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
88
|
+
# should be made on {Client.configure}.
|
89
|
+
#
|
90
|
+
# See {::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client::Configuration}
|
91
|
+
# for a description of the configuration fields.
|
92
|
+
#
|
93
|
+
# @yield [config] Configure the Client client.
|
94
|
+
# @yieldparam config [Client::Configuration]
|
95
|
+
#
|
96
|
+
# @return [Client::Configuration]
|
97
|
+
#
|
98
|
+
def configure
|
99
|
+
yield @config if block_given?
|
100
|
+
@config
|
101
|
+
end
|
102
|
+
|
103
|
+
##
|
104
|
+
# The effective universe domain
|
105
|
+
#
|
106
|
+
# @return [String]
|
107
|
+
#
|
108
|
+
def universe_domain
|
109
|
+
@shipping_settings_service_stub.universe_domain
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Create a new ShippingSettingsService REST client object.
|
114
|
+
#
|
115
|
+
# @example
|
116
|
+
#
|
117
|
+
# # Create a client using the default configuration
|
118
|
+
# client = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client.new
|
119
|
+
#
|
120
|
+
# # Create a client using a custom configuration
|
121
|
+
# client = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client.new do |config|
|
122
|
+
# config.timeout = 10.0
|
123
|
+
# end
|
124
|
+
#
|
125
|
+
# @yield [config] Configure the ShippingSettingsService client.
|
126
|
+
# @yieldparam config [Client::Configuration]
|
127
|
+
#
|
128
|
+
def initialize
|
129
|
+
# Create the configuration object
|
130
|
+
@config = Configuration.new Client.configure
|
131
|
+
|
132
|
+
# Yield the configuration if needed
|
133
|
+
yield @config if block_given?
|
134
|
+
|
135
|
+
# Create credentials
|
136
|
+
credentials = @config.credentials
|
137
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
138
|
+
# but only if the default endpoint does not have a region prefix.
|
139
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
140
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
141
|
+
!@config.endpoint.split(".").first.include?("-"))
|
142
|
+
credentials ||= Credentials.default scope: @config.scope,
|
143
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
144
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
145
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
146
|
+
end
|
147
|
+
|
148
|
+
@quota_project_id = @config.quota_project
|
149
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
150
|
+
|
151
|
+
@shipping_settings_service_stub = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::ServiceStub.new(
|
152
|
+
endpoint: @config.endpoint,
|
153
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
154
|
+
universe_domain: @config.universe_domain,
|
155
|
+
credentials: credentials
|
156
|
+
)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Service calls
|
160
|
+
|
161
|
+
##
|
162
|
+
# Retrieve shipping setting information.
|
163
|
+
#
|
164
|
+
# @overload get_shipping_settings(request, options = nil)
|
165
|
+
# Pass arguments to `get_shipping_settings` via a request object, either of type
|
166
|
+
# {::Google::Shopping::Merchant::Accounts::V1beta::GetShippingSettingsRequest} or an equivalent Hash.
|
167
|
+
#
|
168
|
+
# @param request [::Google::Shopping::Merchant::Accounts::V1beta::GetShippingSettingsRequest, ::Hash]
|
169
|
+
# A request object representing the call parameters. Required. To specify no
|
170
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
171
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
172
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
173
|
+
#
|
174
|
+
# @overload get_shipping_settings(name: nil)
|
175
|
+
# Pass arguments to `get_shipping_settings` via keyword arguments. Note that at
|
176
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
177
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
178
|
+
#
|
179
|
+
# @param name [::String]
|
180
|
+
# Required. The name of the shipping setting to retrieve.
|
181
|
+
# Format: `accounts/{account}/shippingsetting`
|
182
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
183
|
+
# @yieldparam result [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings]
|
184
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
185
|
+
#
|
186
|
+
# @return [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings]
|
187
|
+
#
|
188
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
189
|
+
#
|
190
|
+
# @example Basic example
|
191
|
+
# require "google/shopping/merchant/accounts/v1beta"
|
192
|
+
#
|
193
|
+
# # Create a client object. The client can be reused for multiple calls.
|
194
|
+
# client = Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client.new
|
195
|
+
#
|
196
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
197
|
+
# request = Google::Shopping::Merchant::Accounts::V1beta::GetShippingSettingsRequest.new
|
198
|
+
#
|
199
|
+
# # Call the get_shipping_settings method.
|
200
|
+
# result = client.get_shipping_settings request
|
201
|
+
#
|
202
|
+
# # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings.
|
203
|
+
# p result
|
204
|
+
#
|
205
|
+
def get_shipping_settings request, options = nil
|
206
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
207
|
+
|
208
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::GetShippingSettingsRequest
|
209
|
+
|
210
|
+
# Converts hash and nil to an options object
|
211
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
212
|
+
|
213
|
+
# Customize the options with defaults
|
214
|
+
call_metadata = @config.rpcs.get_shipping_settings.metadata.to_h
|
215
|
+
|
216
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
217
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
218
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
219
|
+
gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION,
|
220
|
+
transports_version_send: [:rest]
|
221
|
+
|
222
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
223
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
224
|
+
|
225
|
+
options.apply_defaults timeout: @config.rpcs.get_shipping_settings.timeout,
|
226
|
+
metadata: call_metadata,
|
227
|
+
retry_policy: @config.rpcs.get_shipping_settings.retry_policy
|
228
|
+
|
229
|
+
options.apply_defaults timeout: @config.timeout,
|
230
|
+
metadata: @config.metadata,
|
231
|
+
retry_policy: @config.retry_policy
|
232
|
+
|
233
|
+
@shipping_settings_service_stub.get_shipping_settings request, options do |result, operation|
|
234
|
+
yield result, operation if block_given?
|
235
|
+
return result
|
236
|
+
end
|
237
|
+
rescue ::Gapic::Rest::Error => e
|
238
|
+
raise ::Google::Cloud::Error.from_error(e)
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# Replace the shipping setting of a merchant with the request shipping
|
243
|
+
# setting. Executing this method requires admin access.
|
244
|
+
#
|
245
|
+
# @overload insert_shipping_settings(request, options = nil)
|
246
|
+
# Pass arguments to `insert_shipping_settings` via a request object, either of type
|
247
|
+
# {::Google::Shopping::Merchant::Accounts::V1beta::InsertShippingSettingsRequest} or an equivalent Hash.
|
248
|
+
#
|
249
|
+
# @param request [::Google::Shopping::Merchant::Accounts::V1beta::InsertShippingSettingsRequest, ::Hash]
|
250
|
+
# A request object representing the call parameters. Required. To specify no
|
251
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
252
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
253
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
254
|
+
#
|
255
|
+
# @overload insert_shipping_settings(parent: nil, shipping_setting: nil)
|
256
|
+
# Pass arguments to `insert_shipping_settings` via keyword arguments. Note that at
|
257
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
258
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
259
|
+
#
|
260
|
+
# @param parent [::String]
|
261
|
+
# Required. The account where this product will be inserted.
|
262
|
+
# Format: accounts/\\{account}
|
263
|
+
# @param shipping_setting [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings, ::Hash]
|
264
|
+
# Required. The new version of the account.
|
265
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
266
|
+
# @yieldparam result [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings]
|
267
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
268
|
+
#
|
269
|
+
# @return [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings]
|
270
|
+
#
|
271
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
272
|
+
#
|
273
|
+
# @example Basic example
|
274
|
+
# require "google/shopping/merchant/accounts/v1beta"
|
275
|
+
#
|
276
|
+
# # Create a client object. The client can be reused for multiple calls.
|
277
|
+
# client = Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client.new
|
278
|
+
#
|
279
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
280
|
+
# request = Google::Shopping::Merchant::Accounts::V1beta::InsertShippingSettingsRequest.new
|
281
|
+
#
|
282
|
+
# # Call the insert_shipping_settings method.
|
283
|
+
# result = client.insert_shipping_settings request
|
284
|
+
#
|
285
|
+
# # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings.
|
286
|
+
# p result
|
287
|
+
#
|
288
|
+
def insert_shipping_settings request, options = nil
|
289
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
290
|
+
|
291
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::InsertShippingSettingsRequest
|
292
|
+
|
293
|
+
# Converts hash and nil to an options object
|
294
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
295
|
+
|
296
|
+
# Customize the options with defaults
|
297
|
+
call_metadata = @config.rpcs.insert_shipping_settings.metadata.to_h
|
298
|
+
|
299
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
300
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
301
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
302
|
+
gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION,
|
303
|
+
transports_version_send: [:rest]
|
304
|
+
|
305
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
306
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
307
|
+
|
308
|
+
options.apply_defaults timeout: @config.rpcs.insert_shipping_settings.timeout,
|
309
|
+
metadata: call_metadata,
|
310
|
+
retry_policy: @config.rpcs.insert_shipping_settings.retry_policy
|
311
|
+
|
312
|
+
options.apply_defaults timeout: @config.timeout,
|
313
|
+
metadata: @config.metadata,
|
314
|
+
retry_policy: @config.retry_policy
|
315
|
+
|
316
|
+
@shipping_settings_service_stub.insert_shipping_settings request, options do |result, operation|
|
317
|
+
yield result, operation if block_given?
|
318
|
+
return result
|
319
|
+
end
|
320
|
+
rescue ::Gapic::Rest::Error => e
|
321
|
+
raise ::Google::Cloud::Error.from_error(e)
|
322
|
+
end
|
323
|
+
|
324
|
+
##
|
325
|
+
# Configuration class for the ShippingSettingsService REST API.
|
326
|
+
#
|
327
|
+
# This class represents the configuration for ShippingSettingsService REST,
|
328
|
+
# providing control over timeouts, retry behavior, logging, transport
|
329
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
330
|
+
# applied individually to specific RPCs. See
|
331
|
+
# {::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client::Configuration::Rpcs}
|
332
|
+
# for a list of RPCs that can be configured independently.
|
333
|
+
#
|
334
|
+
# Configuration can be applied globally to all clients, or to a single client
|
335
|
+
# on construction.
|
336
|
+
#
|
337
|
+
# @example
|
338
|
+
#
|
339
|
+
# # Modify the global config, setting the timeout for
|
340
|
+
# # get_shipping_settings to 20 seconds,
|
341
|
+
# # and all remaining timeouts to 10 seconds.
|
342
|
+
# ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client.configure do |config|
|
343
|
+
# config.timeout = 10.0
|
344
|
+
# config.rpcs.get_shipping_settings.timeout = 20.0
|
345
|
+
# end
|
346
|
+
#
|
347
|
+
# # Apply the above configuration only to a new client.
|
348
|
+
# client = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettingsService::Rest::Client.new do |config|
|
349
|
+
# config.timeout = 10.0
|
350
|
+
# config.rpcs.get_shipping_settings.timeout = 20.0
|
351
|
+
# end
|
352
|
+
#
|
353
|
+
# @!attribute [rw] endpoint
|
354
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
355
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
356
|
+
# @return [::String,nil]
|
357
|
+
# @!attribute [rw] credentials
|
358
|
+
# Credentials to send with calls. You may provide any of the following types:
|
359
|
+
# * (`String`) The path to a service account key file in JSON format
|
360
|
+
# * (`Hash`) A service account key as a Hash
|
361
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
362
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
363
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
364
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
365
|
+
# * (`nil`) indicating no credentials
|
366
|
+
# @return [::Object]
|
367
|
+
# @!attribute [rw] scope
|
368
|
+
# The OAuth scopes
|
369
|
+
# @return [::Array<::String>]
|
370
|
+
# @!attribute [rw] lib_name
|
371
|
+
# The library name as recorded in instrumentation and logging
|
372
|
+
# @return [::String]
|
373
|
+
# @!attribute [rw] lib_version
|
374
|
+
# The library version as recorded in instrumentation and logging
|
375
|
+
# @return [::String]
|
376
|
+
# @!attribute [rw] timeout
|
377
|
+
# The call timeout in seconds.
|
378
|
+
# @return [::Numeric]
|
379
|
+
# @!attribute [rw] metadata
|
380
|
+
# Additional headers to be sent with the call.
|
381
|
+
# @return [::Hash{::Symbol=>::String}]
|
382
|
+
# @!attribute [rw] retry_policy
|
383
|
+
# The retry policy. The value is a hash with the following keys:
|
384
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
385
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
386
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
387
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
388
|
+
# trigger a retry.
|
389
|
+
# @return [::Hash]
|
390
|
+
# @!attribute [rw] quota_project
|
391
|
+
# A separate project against which to charge quota.
|
392
|
+
# @return [::String]
|
393
|
+
# @!attribute [rw] universe_domain
|
394
|
+
# The universe domain within which to make requests. This determines the
|
395
|
+
# default endpoint URL. The default value of nil uses the environment
|
396
|
+
# universe (usually the default "googleapis.com" universe).
|
397
|
+
# @return [::String,nil]
|
398
|
+
#
|
399
|
+
class Configuration
|
400
|
+
extend ::Gapic::Config
|
401
|
+
|
402
|
+
# @private
|
403
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
404
|
+
DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
|
405
|
+
|
406
|
+
config_attr :endpoint, nil, ::String, nil
|
407
|
+
config_attr :credentials, nil do |value|
|
408
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
409
|
+
allowed.any? { |klass| klass === value }
|
410
|
+
end
|
411
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
412
|
+
config_attr :lib_name, nil, ::String, nil
|
413
|
+
config_attr :lib_version, nil, ::String, nil
|
414
|
+
config_attr :timeout, nil, ::Numeric, nil
|
415
|
+
config_attr :metadata, nil, ::Hash, nil
|
416
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
417
|
+
config_attr :quota_project, nil, ::String, nil
|
418
|
+
config_attr :universe_domain, nil, ::String, nil
|
419
|
+
|
420
|
+
# @private
|
421
|
+
def initialize parent_config = nil
|
422
|
+
@parent_config = parent_config unless parent_config.nil?
|
423
|
+
|
424
|
+
yield self if block_given?
|
425
|
+
end
|
426
|
+
|
427
|
+
##
|
428
|
+
# Configurations for individual RPCs
|
429
|
+
# @return [Rpcs]
|
430
|
+
#
|
431
|
+
def rpcs
|
432
|
+
@rpcs ||= begin
|
433
|
+
parent_rpcs = nil
|
434
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
435
|
+
Rpcs.new parent_rpcs
|
436
|
+
end
|
437
|
+
end
|
438
|
+
|
439
|
+
##
|
440
|
+
# Configuration RPC class for the ShippingSettingsService API.
|
441
|
+
#
|
442
|
+
# Includes fields providing the configuration for each RPC in this service.
|
443
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
444
|
+
# the following configuration fields:
|
445
|
+
#
|
446
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
447
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
448
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
449
|
+
# include the following keys:
|
450
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
451
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
452
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
453
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
454
|
+
# trigger a retry.
|
455
|
+
#
|
456
|
+
class Rpcs
|
457
|
+
##
|
458
|
+
# RPC-specific configuration for `get_shipping_settings`
|
459
|
+
# @return [::Gapic::Config::Method]
|
460
|
+
#
|
461
|
+
attr_reader :get_shipping_settings
|
462
|
+
##
|
463
|
+
# RPC-specific configuration for `insert_shipping_settings`
|
464
|
+
# @return [::Gapic::Config::Method]
|
465
|
+
#
|
466
|
+
attr_reader :insert_shipping_settings
|
467
|
+
|
468
|
+
# @private
|
469
|
+
def initialize parent_rpcs = nil
|
470
|
+
get_shipping_settings_config = parent_rpcs.get_shipping_settings if parent_rpcs.respond_to? :get_shipping_settings
|
471
|
+
@get_shipping_settings = ::Gapic::Config::Method.new get_shipping_settings_config
|
472
|
+
insert_shipping_settings_config = parent_rpcs.insert_shipping_settings if parent_rpcs.respond_to? :insert_shipping_settings
|
473
|
+
@insert_shipping_settings = ::Gapic::Config::Method.new insert_shipping_settings_config
|
474
|
+
|
475
|
+
yield self if block_given?
|
476
|
+
end
|
477
|
+
end
|
478
|
+
end
|
479
|
+
end
|
480
|
+
end
|
481
|
+
end
|
482
|
+
end
|
483
|
+
end
|
484
|
+
end
|
485
|
+
end
|
486
|
+
end
|
data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/service_stub.rb
ADDED
@@ -0,0 +1,190 @@
|
|
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/shopping/merchant/accounts/v1beta/shippingsettings_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Shopping
|
23
|
+
module Merchant
|
24
|
+
module Accounts
|
25
|
+
module V1beta
|
26
|
+
module ShippingSettingsService
|
27
|
+
module Rest
|
28
|
+
##
|
29
|
+
# REST service stub for the ShippingSettingsService service.
|
30
|
+
# Service stub contains baseline method implementations
|
31
|
+
# including transcoding, making the REST call, and deserialing the response.
|
32
|
+
#
|
33
|
+
class ServiceStub
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
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
|
+
raise_faraday_errors: false
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
# The effective universe domain
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
#
|
52
|
+
def universe_domain
|
53
|
+
@client_stub.universe_domain
|
54
|
+
end
|
55
|
+
|
56
|
+
##
|
57
|
+
# The effective endpoint
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
#
|
61
|
+
def endpoint
|
62
|
+
@client_stub.endpoint
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# Baseline implementation for the get_shipping_settings REST call
|
67
|
+
#
|
68
|
+
# @param request_pb [::Google::Shopping::Merchant::Accounts::V1beta::GetShippingSettingsRequest]
|
69
|
+
# A request object representing the call parameters. Required.
|
70
|
+
# @param options [::Gapic::CallOptions]
|
71
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
72
|
+
#
|
73
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
74
|
+
# @yieldparam result [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings]
|
75
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
76
|
+
#
|
77
|
+
# @return [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings]
|
78
|
+
# A result object deserialized from the server's reply
|
79
|
+
def get_shipping_settings request_pb, options = nil
|
80
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
81
|
+
|
82
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_shipping_settings_request request_pb
|
83
|
+
query_string_params = if query_string_params.any?
|
84
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
85
|
+
else
|
86
|
+
{}
|
87
|
+
end
|
88
|
+
|
89
|
+
response = @client_stub.make_http_request(
|
90
|
+
verb,
|
91
|
+
uri: uri,
|
92
|
+
body: body || "",
|
93
|
+
params: query_string_params,
|
94
|
+
options: options
|
95
|
+
)
|
96
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
97
|
+
result = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings.decode_json response.body, ignore_unknown_fields: true
|
98
|
+
|
99
|
+
yield result, operation if block_given?
|
100
|
+
result
|
101
|
+
end
|
102
|
+
|
103
|
+
##
|
104
|
+
# Baseline implementation for the insert_shipping_settings REST call
|
105
|
+
#
|
106
|
+
# @param request_pb [::Google::Shopping::Merchant::Accounts::V1beta::InsertShippingSettingsRequest]
|
107
|
+
# A request object representing the call parameters. Required.
|
108
|
+
# @param options [::Gapic::CallOptions]
|
109
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
110
|
+
#
|
111
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
112
|
+
# @yieldparam result [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings]
|
113
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
114
|
+
#
|
115
|
+
# @return [::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings]
|
116
|
+
# A result object deserialized from the server's reply
|
117
|
+
def insert_shipping_settings request_pb, options = nil
|
118
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
119
|
+
|
120
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_insert_shipping_settings_request request_pb
|
121
|
+
query_string_params = if query_string_params.any?
|
122
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
123
|
+
else
|
124
|
+
{}
|
125
|
+
end
|
126
|
+
|
127
|
+
response = @client_stub.make_http_request(
|
128
|
+
verb,
|
129
|
+
uri: uri,
|
130
|
+
body: body || "",
|
131
|
+
params: query_string_params,
|
132
|
+
options: options
|
133
|
+
)
|
134
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
135
|
+
result = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings.decode_json response.body, ignore_unknown_fields: true
|
136
|
+
|
137
|
+
yield result, operation if block_given?
|
138
|
+
result
|
139
|
+
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# @private
|
143
|
+
#
|
144
|
+
# GRPC transcoding helper method for the get_shipping_settings REST call
|
145
|
+
#
|
146
|
+
# @param request_pb [::Google::Shopping::Merchant::Accounts::V1beta::GetShippingSettingsRequest]
|
147
|
+
# A request object representing the call parameters. Required.
|
148
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
149
|
+
# Uri, Body, Query string parameters
|
150
|
+
def self.transcode_get_shipping_settings_request request_pb
|
151
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
152
|
+
.with_bindings(
|
153
|
+
uri_method: :get,
|
154
|
+
uri_template: "/accounts/v1beta/{name}",
|
155
|
+
matches: [
|
156
|
+
["name", %r{^accounts/[^/]+/shippingSettings/?$}, false]
|
157
|
+
]
|
158
|
+
)
|
159
|
+
transcoder.transcode request_pb
|
160
|
+
end
|
161
|
+
|
162
|
+
##
|
163
|
+
# @private
|
164
|
+
#
|
165
|
+
# GRPC transcoding helper method for the insert_shipping_settings REST call
|
166
|
+
#
|
167
|
+
# @param request_pb [::Google::Shopping::Merchant::Accounts::V1beta::InsertShippingSettingsRequest]
|
168
|
+
# A request object representing the call parameters. Required.
|
169
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
170
|
+
# Uri, Body, Query string parameters
|
171
|
+
def self.transcode_insert_shipping_settings_request request_pb
|
172
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
173
|
+
.with_bindings(
|
174
|
+
uri_method: :post,
|
175
|
+
uri_template: "/accounts/v1beta/{parent}/shippingSettings:insert",
|
176
|
+
body: "shipping_setting",
|
177
|
+
matches: [
|
178
|
+
["parent", %r{^accounts/[^/]+/?$}, false]
|
179
|
+
]
|
180
|
+
)
|
181
|
+
transcoder.transcode request_pb
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|