Class: Google::Cloud::Compute::V1::RegionBackendServices::Rest::ServiceStub
- Inherits:
-
Object
- Object
- Google::Cloud::Compute::V1::RegionBackendServices::Rest::ServiceStub
- Defined in:
- lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb
Overview
REST service stub for the RegionBackendServices service. Service stub contains baseline method implementations including transcoding, making the REST call, and deserialing the response.
Instance Method Summary collapse
-
#delete(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation
Baseline implementation for the delete REST call.
-
#get(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::BackendService
Baseline implementation for the get REST call.
-
#get_health(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::BackendServiceGroupHealth
Baseline implementation for the get_health REST call.
-
#get_iam_policy(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Policy
Baseline implementation for the get_iam_policy REST call.
-
#initialize(endpoint:, credentials:) ⇒ ServiceStub
constructor
A new instance of ServiceStub.
-
#insert(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation
Baseline implementation for the insert REST call.
-
#list(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::BackendServiceList
Baseline implementation for the list REST call.
-
#patch(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation
Baseline implementation for the patch REST call.
-
#set_iam_policy(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Policy
Baseline implementation for the set_iam_policy REST call.
-
#update(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation
Baseline implementation for the update REST call.
Constructor Details
#initialize(endpoint:, credentials:) ⇒ ServiceStub
Returns a new instance of ServiceStub.
33 34 35 36 37 38 39 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 33 def initialize endpoint:, credentials: # These require statements are intentionally placed here to initialize # the REST modules only when it's required. require "gapic/rest" @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false end |
Instance Method Details
#delete(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation
Baseline implementation for the delete REST call
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 55 def delete request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_delete_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |
#get(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::BackendService
Baseline implementation for the get REST call
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 92 def get request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_get_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::BackendService.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |
#get_health(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::BackendServiceGroupHealth
Baseline implementation for the get_health REST call
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 129 def get_health request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_get_health_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::BackendServiceGroupHealth.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |
#get_iam_policy(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Policy
Baseline implementation for the get_iam_policy REST call
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 166 def get_iam_policy request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_get_iam_policy_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |
#insert(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation
Baseline implementation for the insert REST call
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 203 def insert request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_insert_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |
#list(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::BackendServiceList
Baseline implementation for the list REST call
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 240 def list request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_list_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::BackendServiceList.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |
#patch(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation
Baseline implementation for the patch REST call
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 277 def patch request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_patch_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |
#set_iam_policy(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Policy
Baseline implementation for the set_iam_policy REST call
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 314 def set_iam_policy request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_set_iam_policy_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |
#update(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation
Baseline implementation for the update REST call
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
# File 'lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb', line 351 def update request_pb, = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = transcode_update_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split("=", 2) } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: ) result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true yield result, response if block_given? result end |