google-cloud-resource_settings-v1 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +3 -3
- data/lib/google/cloud/resource_settings/v1/resource_settings_service/client.rb +6 -8
- data/lib/google/cloud/resource_settings/v1/resource_settings_service/rest/client.rb +542 -0
- data/lib/google/cloud/resource_settings/v1/resource_settings_service/rest/service_stub.rb +270 -0
- data/lib/google/cloud/resource_settings/v1/resource_settings_service/rest.rb +63 -0
- data/lib/google/cloud/resource_settings/v1/resource_settings_service.rb +7 -1
- data/lib/google/cloud/resource_settings/v1/rest.rb +37 -0
- data/lib/google/cloud/resource_settings/v1/version.rb +1 -1
- data/lib/google/cloud/resource_settings/v1.rb +7 -2
- data/lib/google/cloud/resourcesettings/v1/resource_settings_pb.rb +24 -59
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- metadata +17 -8
@@ -0,0 +1,270 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/resourcesettings/v1/resource_settings_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module ResourceSettings
|
24
|
+
module V1
|
25
|
+
module ResourceSettingsService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the ResourceSettingsService service.
|
29
|
+
# Service stub contains baseline method implementations
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
31
|
+
#
|
32
|
+
class ServiceStub
|
33
|
+
def initialize endpoint:, credentials:
|
34
|
+
# These require statements are intentionally placed here to initialize
|
35
|
+
# the REST modules only when it's required.
|
36
|
+
require "gapic/rest"
|
37
|
+
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
39
|
+
numeric_enums: true,
|
40
|
+
raise_faraday_errors: false
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Baseline implementation for the list_settings REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::ResourceSettings::V1::ListSettingsRequest]
|
47
|
+
# A request object representing the call parameters. Required.
|
48
|
+
# @param options [::Gapic::CallOptions]
|
49
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
50
|
+
#
|
51
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
52
|
+
# @yieldparam result [::Google::Cloud::ResourceSettings::V1::ListSettingsResponse]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::ResourceSettings::V1::ListSettingsResponse]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def list_settings request_pb, options = nil
|
58
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
59
|
+
|
60
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_settings_request request_pb
|
61
|
+
query_string_params = if query_string_params.any?
|
62
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
63
|
+
else
|
64
|
+
{}
|
65
|
+
end
|
66
|
+
|
67
|
+
response = @client_stub.make_http_request(
|
68
|
+
verb,
|
69
|
+
uri: uri,
|
70
|
+
body: body || "",
|
71
|
+
params: query_string_params,
|
72
|
+
options: options
|
73
|
+
)
|
74
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
75
|
+
result = ::Google::Cloud::ResourceSettings::V1::ListSettingsResponse.decode_json response.body, ignore_unknown_fields: true
|
76
|
+
|
77
|
+
yield result, operation if block_given?
|
78
|
+
result
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Baseline implementation for the get_setting REST call
|
83
|
+
#
|
84
|
+
# @param request_pb [::Google::Cloud::ResourceSettings::V1::GetSettingRequest]
|
85
|
+
# A request object representing the call parameters. Required.
|
86
|
+
# @param options [::Gapic::CallOptions]
|
87
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
88
|
+
#
|
89
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
90
|
+
# @yieldparam result [::Google::Cloud::ResourceSettings::V1::Setting]
|
91
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
92
|
+
#
|
93
|
+
# @return [::Google::Cloud::ResourceSettings::V1::Setting]
|
94
|
+
# A result object deserialized from the server's reply
|
95
|
+
def get_setting request_pb, options = nil
|
96
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
97
|
+
|
98
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_setting_request request_pb
|
99
|
+
query_string_params = if query_string_params.any?
|
100
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
101
|
+
else
|
102
|
+
{}
|
103
|
+
end
|
104
|
+
|
105
|
+
response = @client_stub.make_http_request(
|
106
|
+
verb,
|
107
|
+
uri: uri,
|
108
|
+
body: body || "",
|
109
|
+
params: query_string_params,
|
110
|
+
options: options
|
111
|
+
)
|
112
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
113
|
+
result = ::Google::Cloud::ResourceSettings::V1::Setting.decode_json response.body, ignore_unknown_fields: true
|
114
|
+
|
115
|
+
yield result, operation if block_given?
|
116
|
+
result
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Baseline implementation for the update_setting REST call
|
121
|
+
#
|
122
|
+
# @param request_pb [::Google::Cloud::ResourceSettings::V1::UpdateSettingRequest]
|
123
|
+
# A request object representing the call parameters. Required.
|
124
|
+
# @param options [::Gapic::CallOptions]
|
125
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
126
|
+
#
|
127
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
128
|
+
# @yieldparam result [::Google::Cloud::ResourceSettings::V1::Setting]
|
129
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
130
|
+
#
|
131
|
+
# @return [::Google::Cloud::ResourceSettings::V1::Setting]
|
132
|
+
# A result object deserialized from the server's reply
|
133
|
+
def update_setting request_pb, options = nil
|
134
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
135
|
+
|
136
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_update_setting_request request_pb
|
137
|
+
query_string_params = if query_string_params.any?
|
138
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
139
|
+
else
|
140
|
+
{}
|
141
|
+
end
|
142
|
+
|
143
|
+
response = @client_stub.make_http_request(
|
144
|
+
verb,
|
145
|
+
uri: uri,
|
146
|
+
body: body || "",
|
147
|
+
params: query_string_params,
|
148
|
+
options: options
|
149
|
+
)
|
150
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
151
|
+
result = ::Google::Cloud::ResourceSettings::V1::Setting.decode_json response.body, ignore_unknown_fields: true
|
152
|
+
|
153
|
+
yield result, operation if block_given?
|
154
|
+
result
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# @private
|
159
|
+
#
|
160
|
+
# GRPC transcoding helper method for the list_settings REST call
|
161
|
+
#
|
162
|
+
# @param request_pb [::Google::Cloud::ResourceSettings::V1::ListSettingsRequest]
|
163
|
+
# A request object representing the call parameters. Required.
|
164
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
165
|
+
# Uri, Body, Query string parameters
|
166
|
+
def self.transcode_list_settings_request request_pb
|
167
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
168
|
+
.with_bindings(
|
169
|
+
uri_method: :get,
|
170
|
+
uri_template: "/v1/{parent}/settings",
|
171
|
+
matches: [
|
172
|
+
["parent", %r{^organizations/[^/]+/?$}, false]
|
173
|
+
]
|
174
|
+
)
|
175
|
+
.with_bindings(
|
176
|
+
uri_method: :get,
|
177
|
+
uri_template: "/v1/{parent}/settings",
|
178
|
+
matches: [
|
179
|
+
["parent", %r{^folders/[^/]+/?$}, false]
|
180
|
+
]
|
181
|
+
)
|
182
|
+
.with_bindings(
|
183
|
+
uri_method: :get,
|
184
|
+
uri_template: "/v1/{parent}/settings",
|
185
|
+
matches: [
|
186
|
+
["parent", %r{^projects/[^/]+/?$}, false]
|
187
|
+
]
|
188
|
+
)
|
189
|
+
transcoder.transcode request_pb
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# @private
|
194
|
+
#
|
195
|
+
# GRPC transcoding helper method for the get_setting REST call
|
196
|
+
#
|
197
|
+
# @param request_pb [::Google::Cloud::ResourceSettings::V1::GetSettingRequest]
|
198
|
+
# A request object representing the call parameters. Required.
|
199
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
200
|
+
# Uri, Body, Query string parameters
|
201
|
+
def self.transcode_get_setting_request request_pb
|
202
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
203
|
+
.with_bindings(
|
204
|
+
uri_method: :get,
|
205
|
+
uri_template: "/v1/{name}",
|
206
|
+
matches: [
|
207
|
+
["name", %r{^organizations/[^/]+/settings/[^/]+/?$}, false]
|
208
|
+
]
|
209
|
+
)
|
210
|
+
.with_bindings(
|
211
|
+
uri_method: :get,
|
212
|
+
uri_template: "/v1/{name}",
|
213
|
+
matches: [
|
214
|
+
["name", %r{^folders/[^/]+/settings/[^/]+/?$}, false]
|
215
|
+
]
|
216
|
+
)
|
217
|
+
.with_bindings(
|
218
|
+
uri_method: :get,
|
219
|
+
uri_template: "/v1/{name}",
|
220
|
+
matches: [
|
221
|
+
["name", %r{^projects/[^/]+/settings/[^/]+/?$}, false]
|
222
|
+
]
|
223
|
+
)
|
224
|
+
transcoder.transcode request_pb
|
225
|
+
end
|
226
|
+
|
227
|
+
##
|
228
|
+
# @private
|
229
|
+
#
|
230
|
+
# GRPC transcoding helper method for the update_setting REST call
|
231
|
+
#
|
232
|
+
# @param request_pb [::Google::Cloud::ResourceSettings::V1::UpdateSettingRequest]
|
233
|
+
# A request object representing the call parameters. Required.
|
234
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
235
|
+
# Uri, Body, Query string parameters
|
236
|
+
def self.transcode_update_setting_request request_pb
|
237
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
238
|
+
.with_bindings(
|
239
|
+
uri_method: :patch,
|
240
|
+
uri_template: "/v1/{setting.name}",
|
241
|
+
body: "setting",
|
242
|
+
matches: [
|
243
|
+
["setting.name", %r{^organizations/[^/]+/settings/[^/]+/?$}, false]
|
244
|
+
]
|
245
|
+
)
|
246
|
+
.with_bindings(
|
247
|
+
uri_method: :patch,
|
248
|
+
uri_template: "/v1/{setting.name}",
|
249
|
+
body: "setting",
|
250
|
+
matches: [
|
251
|
+
["setting.name", %r{^folders/[^/]+/settings/[^/]+/?$}, false]
|
252
|
+
]
|
253
|
+
)
|
254
|
+
.with_bindings(
|
255
|
+
uri_method: :patch,
|
256
|
+
uri_template: "/v1/{setting.name}",
|
257
|
+
body: "setting",
|
258
|
+
matches: [
|
259
|
+
["setting.name", %r{^projects/[^/]+/settings/[^/]+/?$}, false]
|
260
|
+
]
|
261
|
+
)
|
262
|
+
transcoder.transcode request_pb
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/cloud/resource_settings/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/resource_settings/v1/resource_settings_service/credentials"
|
26
|
+
require "google/cloud/resource_settings/v1/resource_settings_service/paths"
|
27
|
+
require "google/cloud/resource_settings/v1/resource_settings_service/rest/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module ResourceSettings
|
32
|
+
module V1
|
33
|
+
##
|
34
|
+
# An interface to interact with resource settings and setting values throughout
|
35
|
+
# the resource hierarchy.
|
36
|
+
#
|
37
|
+
# Services may surface a number of settings for users to control how their
|
38
|
+
# resources behave. Values of settings applied on a given Cloud resource are
|
39
|
+
# evaluated hierarchically and inherited by all descendants of that resource.
|
40
|
+
#
|
41
|
+
# For all requests, returns a `google.rpc.Status` with
|
42
|
+
# `google.rpc.Code.PERMISSION_DENIED` if the IAM check fails or the `parent`
|
43
|
+
# resource is not in a Cloud Organization.
|
44
|
+
# For all requests, returns a `google.rpc.Status` with
|
45
|
+
# `google.rpc.Code.INVALID_ARGUMENT` if the request is malformed.
|
46
|
+
#
|
47
|
+
# To load this service and instantiate a REST client:
|
48
|
+
#
|
49
|
+
# require "google/cloud/resource_settings/v1/resource_settings_service/rest"
|
50
|
+
# client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Rest::Client.new
|
51
|
+
#
|
52
|
+
module ResourceSettingsService
|
53
|
+
# Client for the REST transport
|
54
|
+
module Rest
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
63
|
+
require "google/cloud/resource_settings/v1/resource_settings_service/rest/helpers" if ::File.file? helper_path
|
@@ -25,6 +25,7 @@ require "google/cloud/resource_settings/v1/version"
|
|
25
25
|
require "google/cloud/resource_settings/v1/resource_settings_service/credentials"
|
26
26
|
require "google/cloud/resource_settings/v1/resource_settings_service/paths"
|
27
27
|
require "google/cloud/resource_settings/v1/resource_settings_service/client"
|
28
|
+
require "google/cloud/resource_settings/v1/resource_settings_service/rest"
|
28
29
|
|
29
30
|
module Google
|
30
31
|
module Cloud
|
@@ -44,11 +45,16 @@ module Google
|
|
44
45
|
# For all requests, returns a `google.rpc.Status` with
|
45
46
|
# `google.rpc.Code.INVALID_ARGUMENT` if the request is malformed.
|
46
47
|
#
|
47
|
-
#
|
48
|
+
# @example Load this service and instantiate a gRPC client
|
48
49
|
#
|
49
50
|
# require "google/cloud/resource_settings/v1/resource_settings_service"
|
50
51
|
# client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new
|
51
52
|
#
|
53
|
+
# @example Load this service and instantiate a REST client
|
54
|
+
#
|
55
|
+
# require "google/cloud/resource_settings/v1/resource_settings_service/rest"
|
56
|
+
# client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Rest::Client.new
|
57
|
+
#
|
52
58
|
module ResourceSettingsService
|
53
59
|
end
|
54
60
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/resource_settings/v1/resource_settings_service/rest"
|
20
|
+
require "google/cloud/resource_settings/v1/version"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module ResourceSettings
|
25
|
+
##
|
26
|
+
# To load just the REST part of this package, including all its services, and instantiate a REST client:
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
#
|
30
|
+
# require "google/cloud/resource_settings/v1/rest"
|
31
|
+
# client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Rest::Client.new
|
32
|
+
#
|
33
|
+
module V1
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -23,13 +23,18 @@ module Google
|
|
23
23
|
module Cloud
|
24
24
|
module ResourceSettings
|
25
25
|
##
|
26
|
-
#
|
26
|
+
# API client module.
|
27
27
|
#
|
28
|
-
# @example
|
28
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
29
29
|
#
|
30
30
|
# require "google/cloud/resource_settings/v1"
|
31
31
|
# client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new
|
32
32
|
#
|
33
|
+
# @example Load this package, including all its services, and instantiate a REST client
|
34
|
+
#
|
35
|
+
# require "google/cloud/resource_settings/v1"
|
36
|
+
# client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Rest::Client.new
|
37
|
+
#
|
33
38
|
module V1
|
34
39
|
end
|
35
40
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/resourcesettings/v1/resource_settings.proto
|
3
4
|
|
@@ -8,67 +9,31 @@ require 'google/api/client_pb'
|
|
8
9
|
require 'google/api/field_behavior_pb'
|
9
10
|
require 'google/api/resource_pb'
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
value :ENUM_VALUE, 4
|
33
|
-
end
|
34
|
-
add_message "google.cloud.resourcesettings.v1.Value" do
|
35
|
-
oneof :value do
|
36
|
-
optional :boolean_value, :bool, 1
|
37
|
-
optional :string_value, :string, 2
|
38
|
-
optional :string_set_value, :message, 3, "google.cloud.resourcesettings.v1.Value.StringSet"
|
39
|
-
optional :enum_value, :message, 4, "google.cloud.resourcesettings.v1.Value.EnumValue"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
add_message "google.cloud.resourcesettings.v1.Value.StringSet" do
|
43
|
-
repeated :values, :string, 1
|
44
|
-
end
|
45
|
-
add_message "google.cloud.resourcesettings.v1.Value.EnumValue" do
|
46
|
-
optional :value, :string, 1
|
47
|
-
end
|
48
|
-
add_message "google.cloud.resourcesettings.v1.ListSettingsRequest" do
|
49
|
-
optional :parent, :string, 1
|
50
|
-
optional :page_size, :int32, 2
|
51
|
-
optional :page_token, :string, 3
|
52
|
-
optional :view, :enum, 4, "google.cloud.resourcesettings.v1.SettingView"
|
53
|
-
end
|
54
|
-
add_message "google.cloud.resourcesettings.v1.ListSettingsResponse" do
|
55
|
-
repeated :settings, :message, 1, "google.cloud.resourcesettings.v1.Setting"
|
56
|
-
optional :next_page_token, :string, 2
|
57
|
-
end
|
58
|
-
add_message "google.cloud.resourcesettings.v1.GetSettingRequest" do
|
59
|
-
optional :name, :string, 1
|
60
|
-
optional :view, :enum, 2, "google.cloud.resourcesettings.v1.SettingView"
|
61
|
-
end
|
62
|
-
add_message "google.cloud.resourcesettings.v1.UpdateSettingRequest" do
|
63
|
-
optional :setting, :message, 1, "google.cloud.resourcesettings.v1.Setting"
|
64
|
-
end
|
65
|
-
add_enum "google.cloud.resourcesettings.v1.SettingView" do
|
66
|
-
value :SETTING_VIEW_UNSPECIFIED, 0
|
67
|
-
value :SETTING_VIEW_BASIC, 1
|
68
|
-
value :SETTING_VIEW_EFFECTIVE_VALUE, 2
|
69
|
-
value :SETTING_VIEW_LOCAL_VALUE, 3
|
12
|
+
|
13
|
+
descriptor_data = "\n8google/cloud/resourcesettings/v1/resource_settings.proto\x12 google.cloud.resourcesettings.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb7\x03\n\x07Setting\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x08metadata\x18\x07 \x01(\x0b\x32\x31.google.cloud.resourcesettings.v1.SettingMetadataB\x03\xe0\x41\x03\x12<\n\x0blocal_value\x18\x08 \x01(\x0b\x32\'.google.cloud.resourcesettings.v1.Value\x12\x45\n\x0f\x65\x66\x66\x65\x63tive_value\x18\t \x01(\x0b\x32\'.google.cloud.resourcesettings.v1.ValueB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\n \x01(\t:\xc0\x01\xea\x41\xbc\x01\n\'resourcesettings.googleapis.com/Setting\x12\x31projects/{project_number}/settings/{setting_name}\x12(folders/{folder}/settings/{setting_name}\x12\x34organizations/{organization}/settings/{setting_name}\"\xbe\x02\n\x0fSettingMetadata\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x11\n\tread_only\x18\x03 \x01(\x08\x12M\n\tdata_type\x18\x04 \x01(\x0e\x32:.google.cloud.resourcesettings.v1.SettingMetadata.DataType\x12>\n\rdefault_value\x18\x05 \x01(\x0b\x32\'.google.cloud.resourcesettings.v1.Value\"^\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x42OOLEAN\x10\x01\x12\n\n\x06STRING\x10\x02\x12\x0e\n\nSTRING_SET\x10\x03\x12\x0e\n\nENUM_VALUE\x10\x04\"\x92\x02\n\x05Value\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x16\n\x0cstring_value\x18\x02 \x01(\tH\x00\x12M\n\x10string_set_value\x18\x03 \x01(\x0b\x32\x31.google.cloud.resourcesettings.v1.Value.StringSetH\x00\x12G\n\nenum_value\x18\x04 \x01(\x0b\x32\x31.google.cloud.resourcesettings.v1.Value.EnumValueH\x00\x1a\x1b\n\tStringSet\x12\x0e\n\x06values\x18\x01 \x03(\t\x1a\x1a\n\tEnumValue\x12\r\n\x05value\x18\x01 \x01(\tB\x07\n\x05value\"\x94\x01\n\x13ListSettingsRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12;\n\x04view\x18\x04 \x01(\x0e\x32-.google.cloud.resourcesettings.v1.SettingView\"l\n\x14ListSettingsResponse\x12;\n\x08settings\x18\x01 \x03(\x0b\x32).google.cloud.resourcesettings.v1.Setting\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8f\x01\n\x11GetSettingRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'resourcesettings.googleapis.com/Setting\x12;\n\x04view\x18\x02 \x01(\x0e\x32-.google.cloud.resourcesettings.v1.SettingView\"W\n\x14UpdateSettingRequest\x12?\n\x07setting\x18\x01 \x01(\x0b\x32).google.cloud.resourcesettings.v1.SettingB\x03\xe0\x41\x02*\x83\x01\n\x0bSettingView\x12\x1c\n\x18SETTING_VIEW_UNSPECIFIED\x10\x00\x12\x16\n\x12SETTING_VIEW_BASIC\x10\x01\x12 \n\x1cSETTING_VIEW_EFFECTIVE_VALUE\x10\x02\x12\x1c\n\x18SETTING_VIEW_LOCAL_VALUE\x10\x03\x32\xf9\x06\n\x17ResourceSettingsService\x12\xfc\x01\n\x0cListSettings\x12\x35.google.cloud.resourcesettings.v1.ListSettingsRequest\x1a\x36.google.cloud.resourcesettings.v1.ListSettingsResponse\"}\x82\xd3\xe4\x93\x02n\x12%/v1/{parent=organizations/*}/settingsZ!\x12\x1f/v1/{parent=folders/*}/settingsZ\"\x12 /v1/{parent=projects/*}/settings\xda\x41\x06parent\x12\xe9\x01\n\nGetSetting\x12\x33.google.cloud.resourcesettings.v1.GetSettingRequest\x1a).google.cloud.resourcesettings.v1.Setting\"{\x82\xd3\xe4\x93\x02n\x12%/v1/{name=organizations/*/settings/*}Z!\x12\x1f/v1/{name=folders/*/settings/*}Z\"\x12 /v1/{name=projects/*/settings/*}\xda\x41\x04name\x12\x9d\x02\n\rUpdateSetting\x12\x36.google.cloud.resourcesettings.v1.UpdateSettingRequest\x1a).google.cloud.resourcesettings.v1.Setting\"\xa8\x01\x82\xd3\xe4\x93\x02\xa1\x01\x32-/v1/{setting.name=organizations/*/settings/*}:\x07settingZ22\'/v1/{setting.name=folders/*/settings/*}:\x07settingZ32(/v1/{setting.name=projects/*/settings/*}:\x07setting\x1aS\xca\x41\x1fresourcesettings.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x80\x02\n$com.google.cloud.resourcesettings.v1B\x15ResourceSettingsProtoP\x01ZPcloud.google.com/go/resourcesettings/apiv1/resourcesettingspb;resourcesettingspb\xf8\x01\x01\xaa\x02 Google.Cloud.ResourceSettings.V1\xca\x02 Google\\Cloud\\ResourceSettings\\V1\xea\x02#Google::Cloud::ResourceSettings::V1b\x06proto3"
|
14
|
+
|
15
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
16
|
+
|
17
|
+
begin
|
18
|
+
pool.add_serialized_file(descriptor_data)
|
19
|
+
rescue TypeError => e
|
20
|
+
# Compatibility code: will be removed in the next major version.
|
21
|
+
require 'google/protobuf/descriptor_pb'
|
22
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
23
|
+
parsed.clear_dependency
|
24
|
+
serialized = parsed.class.encode(parsed)
|
25
|
+
file = pool.add_serialized_file(serialized)
|
26
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
27
|
+
imports = [
|
28
|
+
]
|
29
|
+
imports.each do |type_name, expected_filename|
|
30
|
+
import_file = pool.lookup(type_name).file_descriptor
|
31
|
+
if import_file.name != expected_filename
|
32
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
70
33
|
end
|
71
34
|
end
|
35
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
36
|
+
warn "This will become an error in the next major version."
|
72
37
|
end
|
73
38
|
|
74
39
|
module Google
|