google-cloud-gaming-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-gaming-v1.rb +21 -0
  7. data/lib/google/cloud/gaming/v1.rb +38 -0
  8. data/lib/google/cloud/gaming/v1/common_pb.rb +117 -0
  9. data/lib/google/cloud/gaming/v1/game_server_clusters_pb.rb +111 -0
  10. data/lib/google/cloud/gaming/v1/game_server_clusters_service.rb +51 -0
  11. data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +994 -0
  12. data/lib/google/cloud/gaming/v1/game_server_clusters_service/credentials.rb +51 -0
  13. data/lib/google/cloud/gaming/v1/game_server_clusters_service/operations.rb +570 -0
  14. data/lib/google/cloud/gaming/v1/game_server_clusters_service/paths.rb +73 -0
  15. data/lib/google/cloud/gaming/v1/game_server_clusters_service_pb.rb +22 -0
  16. data/lib/google/cloud/gaming/v1/game_server_clusters_service_services_pb.rb +61 -0
  17. data/lib/google/cloud/gaming/v1/game_server_configs_pb.rb +73 -0
  18. data/lib/google/cloud/gaming/v1/game_server_configs_service.rb +50 -0
  19. data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +652 -0
  20. data/lib/google/cloud/gaming/v1/game_server_configs_service/credentials.rb +51 -0
  21. data/lib/google/cloud/gaming/v1/game_server_configs_service/operations.rb +570 -0
  22. data/lib/google/cloud/gaming/v1/game_server_configs_service/paths.rb +73 -0
  23. data/lib/google/cloud/gaming/v1/game_server_configs_service_pb.rb +22 -0
  24. data/lib/google/cloud/gaming/v1/game_server_configs_service_services_pb.rb +55 -0
  25. data/lib/google/cloud/gaming/v1/game_server_deployments_pb.rb +119 -0
  26. data/lib/google/cloud/gaming/v1/game_server_deployments_service.rb +51 -0
  27. data/lib/google/cloud/gaming/v1/game_server_deployments_service/client.rb +1082 -0
  28. data/lib/google/cloud/gaming/v1/game_server_deployments_service/credentials.rb +51 -0
  29. data/lib/google/cloud/gaming/v1/game_server_deployments_service/operations.rb +570 -0
  30. data/lib/google/cloud/gaming/v1/game_server_deployments_service/paths.rb +88 -0
  31. data/lib/google/cloud/gaming/v1/game_server_deployments_service_pb.rb +22 -0
  32. data/lib/google/cloud/gaming/v1/game_server_deployments_service_services_pb.rb +70 -0
  33. data/lib/google/cloud/gaming/v1/realms_pb.rb +78 -0
  34. data/lib/google/cloud/gaming/v1/realms_service.rb +51 -0
  35. data/lib/google/cloud/gaming/v1/realms_service/client.rb +821 -0
  36. data/lib/google/cloud/gaming/v1/realms_service/credentials.rb +51 -0
  37. data/lib/google/cloud/gaming/v1/realms_service/operations.rb +570 -0
  38. data/lib/google/cloud/gaming/v1/realms_service/paths.rb +69 -0
  39. data/lib/google/cloud/gaming/v1/realms_service_pb.rb +22 -0
  40. data/lib/google/cloud/gaming/v1/realms_service_services_pb.rb +56 -0
  41. data/lib/google/cloud/gaming/v1/version.rb +28 -0
  42. data/proto_docs/README.md +4 -0
  43. data/proto_docs/google/api/field_behavior.rb +59 -0
  44. data/proto_docs/google/api/resource.rb +247 -0
  45. data/proto_docs/google/cloud/gaming/v1/common.rb +303 -0
  46. data/proto_docs/google/cloud/gaming/v1/game_server_clusters.rb +288 -0
  47. data/proto_docs/google/cloud/gaming/v1/game_server_configs.rb +186 -0
  48. data/proto_docs/google/cloud/gaming/v1/game_server_deployments.rb +317 -0
  49. data/proto_docs/google/cloud/gaming/v1/realms.rb +197 -0
  50. data/proto_docs/google/longrunning/operations.rb +150 -0
  51. data/proto_docs/google/protobuf/any.rb +138 -0
  52. data/proto_docs/google/protobuf/duration.rb +98 -0
  53. data/proto_docs/google/protobuf/empty.rb +36 -0
  54. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  55. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  56. data/proto_docs/google/rpc/status.rb +46 -0
  57. metadata +239 -0
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Cloud
22
+ module Gaming
23
+ module V1
24
+ module GameServerDeploymentsService
25
+ # Path helper methods for the GameServerDeploymentsService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified GameServerDeployment resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param deployment [String]
37
+ #
38
+ # @return [::String]
39
+ def game_server_deployment_path project:, location:, deployment:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/gameServerDeployments/#{deployment}"
44
+ end
45
+
46
+ ##
47
+ # Create a fully-qualified GameServerDeploymentRollout resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`
52
+ #
53
+ # @param project [String]
54
+ # @param location [String]
55
+ # @param deployment [String]
56
+ #
57
+ # @return [::String]
58
+ def game_server_deployment_rollout_path project:, location:, deployment:
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
61
+
62
+ "projects/#{project}/locations/#{location}/gameServerDeployments/#{deployment}/rollout"
63
+ end
64
+
65
+ ##
66
+ # Create a fully-qualified Location resource string.
67
+ #
68
+ # The resource will be in the following format:
69
+ #
70
+ # `projects/{project}/locations/{location}`
71
+ #
72
+ # @param project [String]
73
+ # @param location [String]
74
+ #
75
+ # @return [::String]
76
+ def location_path project:, location:
77
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
78
+
79
+ "projects/#{project}/locations/#{location}"
80
+ end
81
+
82
+ extend self
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,22 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/gaming/v1/game_server_deployments_service.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/client_pb'
8
+ require 'google/cloud/gaming/v1/game_server_deployments_pb'
9
+ require 'google/longrunning/operations_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_file("google/cloud/gaming/v1/game_server_deployments_service.proto", :syntax => :proto3) do
12
+ end
13
+ end
14
+
15
+ module Google
16
+ module Cloud
17
+ module Gaming
18
+ module V1
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,70 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/gaming/v1/game_server_deployments_service.proto for package 'google.cloud.gaming.v1'
3
+ # Original file comments:
4
+ # Copyright 2020 Google LLC
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/cloud/gaming/v1/game_server_deployments_service_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Gaming
25
+ module V1
26
+ module GameServerDeploymentsService
27
+ # The game server deployment is used to control the deployment of Agones
28
+ # fleets.
29
+ class Service
30
+
31
+ include GRPC::GenericService
32
+
33
+ self.marshal_class_method = :encode
34
+ self.unmarshal_class_method = :decode
35
+ self.service_name = 'google.cloud.gaming.v1.GameServerDeploymentsService'
36
+
37
+ # Lists game server deployments in a given project and location.
38
+ rpc :ListGameServerDeployments, Google::Cloud::Gaming::V1::ListGameServerDeploymentsRequest, Google::Cloud::Gaming::V1::ListGameServerDeploymentsResponse
39
+ # Gets details of a single game server deployment.
40
+ rpc :GetGameServerDeployment, Google::Cloud::Gaming::V1::GetGameServerDeploymentRequest, Google::Cloud::Gaming::V1::GameServerDeployment
41
+ # Creates a new game server deployment in a given project and location.
42
+ rpc :CreateGameServerDeployment, Google::Cloud::Gaming::V1::CreateGameServerDeploymentRequest, Google::Longrunning::Operation
43
+ # Deletes a single game server deployment.
44
+ rpc :DeleteGameServerDeployment, Google::Cloud::Gaming::V1::DeleteGameServerDeploymentRequest, Google::Longrunning::Operation
45
+ # Patches a game server deployment.
46
+ rpc :UpdateGameServerDeployment, Google::Cloud::Gaming::V1::UpdateGameServerDeploymentRequest, Google::Longrunning::Operation
47
+ # Gets details a single game server deployment rollout.
48
+ rpc :GetGameServerDeploymentRollout, Google::Cloud::Gaming::V1::GetGameServerDeploymentRolloutRequest, Google::Cloud::Gaming::V1::GameServerDeploymentRollout
49
+ # Patches a single game server deployment rollout.
50
+ # The method will not return an error if the update does not affect any
51
+ # existing realms. For example - if the default_game_server_config is changed
52
+ # but all existing realms use the override, that is valid. Similarly, if a
53
+ # non existing realm is explicitly called out in game_server_config_overrides
54
+ # field, that will also not result in an error.
55
+ rpc :UpdateGameServerDeploymentRollout, Google::Cloud::Gaming::V1::UpdateGameServerDeploymentRolloutRequest, Google::Longrunning::Operation
56
+ # Previews the game server deployment rollout. This API does not mutate the
57
+ # rollout resource.
58
+ rpc :PreviewGameServerDeploymentRollout, Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutRequest, Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutResponse
59
+ # Retrieves information about the current state of the game server
60
+ # deployment. Gathers all the Agones fleets and Agones autoscalers,
61
+ # including fleets running an older version of the game server deployment.
62
+ rpc :FetchDeploymentState, Google::Cloud::Gaming::V1::FetchDeploymentStateRequest, Google::Cloud::Gaming::V1::FetchDeploymentStateResponse
63
+ end
64
+
65
+ Stub = Service.rpc_stub_class
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,78 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/gaming/v1/realms.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/field_behavior_pb'
7
+ require 'google/api/resource_pb'
8
+ require 'google/cloud/gaming/v1/common_pb'
9
+ require 'google/protobuf/field_mask_pb'
10
+ require 'google/protobuf/timestamp_pb'
11
+ require 'google/api/annotations_pb'
12
+ Google::Protobuf::DescriptorPool.generated_pool.build do
13
+ add_file("google/cloud/gaming/v1/realms.proto", :syntax => :proto3) do
14
+ add_message "google.cloud.gaming.v1.ListRealmsRequest" do
15
+ optional :parent, :string, 1
16
+ optional :page_size, :int32, 2
17
+ optional :page_token, :string, 3
18
+ optional :filter, :string, 4
19
+ optional :order_by, :string, 5
20
+ end
21
+ add_message "google.cloud.gaming.v1.ListRealmsResponse" do
22
+ repeated :realms, :message, 1, "google.cloud.gaming.v1.Realm"
23
+ optional :next_page_token, :string, 2
24
+ repeated :unreachable, :string, 3
25
+ end
26
+ add_message "google.cloud.gaming.v1.GetRealmRequest" do
27
+ optional :name, :string, 1
28
+ end
29
+ add_message "google.cloud.gaming.v1.CreateRealmRequest" do
30
+ optional :parent, :string, 1
31
+ optional :realm_id, :string, 2
32
+ optional :realm, :message, 3, "google.cloud.gaming.v1.Realm"
33
+ end
34
+ add_message "google.cloud.gaming.v1.DeleteRealmRequest" do
35
+ optional :name, :string, 1
36
+ end
37
+ add_message "google.cloud.gaming.v1.UpdateRealmRequest" do
38
+ optional :realm, :message, 1, "google.cloud.gaming.v1.Realm"
39
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
40
+ end
41
+ add_message "google.cloud.gaming.v1.PreviewRealmUpdateRequest" do
42
+ optional :realm, :message, 1, "google.cloud.gaming.v1.Realm"
43
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
44
+ optional :preview_time, :message, 3, "google.protobuf.Timestamp"
45
+ end
46
+ add_message "google.cloud.gaming.v1.PreviewRealmUpdateResponse" do
47
+ optional :etag, :string, 2
48
+ optional :target_state, :message, 3, "google.cloud.gaming.v1.TargetState"
49
+ end
50
+ add_message "google.cloud.gaming.v1.Realm" do
51
+ optional :name, :string, 1
52
+ optional :create_time, :message, 2, "google.protobuf.Timestamp"
53
+ optional :update_time, :message, 3, "google.protobuf.Timestamp"
54
+ map :labels, :string, :string, 4
55
+ optional :time_zone, :string, 6
56
+ optional :etag, :string, 7
57
+ optional :description, :string, 8
58
+ end
59
+ end
60
+ end
61
+
62
+ module Google
63
+ module Cloud
64
+ module Gaming
65
+ module V1
66
+ ListRealmsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.ListRealmsRequest").msgclass
67
+ ListRealmsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.ListRealmsResponse").msgclass
68
+ GetRealmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.GetRealmRequest").msgclass
69
+ CreateRealmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.CreateRealmRequest").msgclass
70
+ DeleteRealmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.DeleteRealmRequest").msgclass
71
+ UpdateRealmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.UpdateRealmRequest").msgclass
72
+ PreviewRealmUpdateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.PreviewRealmUpdateRequest").msgclass
73
+ PreviewRealmUpdateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.PreviewRealmUpdateResponse").msgclass
74
+ Realm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gaming.v1.Realm").msgclass
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/gaming/v1/version"
24
+
25
+ require "google/cloud/gaming/v1/realms_service/credentials"
26
+ require "google/cloud/gaming/v1/realms_service/paths"
27
+ require "google/cloud/gaming/v1/realms_service/operations"
28
+ require "google/cloud/gaming/v1/realms_service/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Gaming
33
+ module V1
34
+ ##
35
+ # A realm is a grouping of game server clusters that are considered
36
+ # interchangeable.
37
+ #
38
+ # To load this service and instantiate a client:
39
+ #
40
+ # require "google/cloud/gaming/v1/realms_service"
41
+ # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new
42
+ #
43
+ module RealmsService
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "realms_service", "helpers.rb"
51
+ require "google/cloud/gaming/v1/realms_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,821 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/cloud/gaming/v1/realms_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Gaming
25
+ module V1
26
+ module RealmsService
27
+ ##
28
+ # Client for the RealmsService service.
29
+ #
30
+ # A realm is a grouping of game server clusters that are considered
31
+ # interchangeable.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :realms_service_stub
38
+
39
+ ##
40
+ # Configure the RealmsService Client class.
41
+ #
42
+ # See {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all RealmsService clients:
48
+ #
49
+ # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Gaming", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const&.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.list_realms.timeout = 60.0
70
+ default_config.rpcs.list_realms.retry_policy = {
71
+ initial_delay: 1.0,
72
+ max_delay: 10.0,
73
+ multiplier: 1.3,
74
+ retry_codes: [14]
75
+ }
76
+
77
+ default_config.rpcs.get_realm.timeout = 60.0
78
+ default_config.rpcs.get_realm.retry_policy = {
79
+ initial_delay: 1.0,
80
+ max_delay: 10.0,
81
+ multiplier: 1.3,
82
+ retry_codes: [14]
83
+ }
84
+
85
+ default_config.rpcs.create_realm.timeout = 60.0
86
+
87
+ default_config.rpcs.delete_realm.timeout = 60.0
88
+
89
+ default_config.rpcs.update_realm.timeout = 60.0
90
+
91
+ default_config.rpcs.preview_realm_update.timeout = 60.0
92
+ default_config.rpcs.preview_realm_update.retry_policy = {
93
+ initial_delay: 1.0,
94
+ max_delay: 10.0,
95
+ multiplier: 1.3,
96
+ retry_codes: [14]
97
+ }
98
+
99
+ default_config
100
+ end
101
+ yield @configure if block_given?
102
+ @configure
103
+ end
104
+
105
+ ##
106
+ # Configure the RealmsService Client instance.
107
+ #
108
+ # The configuration is set to the derived mode, meaning that values can be changed,
109
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
110
+ # should be made on {Client.configure}.
111
+ #
112
+ # See {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration}
113
+ # for a description of the configuration fields.
114
+ #
115
+ # @yield [config] Configure the Client client.
116
+ # @yieldparam config [Client::Configuration]
117
+ #
118
+ # @return [Client::Configuration]
119
+ #
120
+ def configure
121
+ yield @config if block_given?
122
+ @config
123
+ end
124
+
125
+ ##
126
+ # Create a new RealmsService client object.
127
+ #
128
+ # ## Examples
129
+ #
130
+ # To create a new RealmsService client with the default
131
+ # configuration:
132
+ #
133
+ # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new
134
+ #
135
+ # To create a new RealmsService client with a custom
136
+ # configuration:
137
+ #
138
+ # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
139
+ # config.timeout = 10.0
140
+ # end
141
+ #
142
+ # @yield [config] Configure the RealmsService client.
143
+ # @yieldparam config [Client::Configuration]
144
+ #
145
+ def initialize
146
+ # These require statements are intentionally placed here to initialize
147
+ # the gRPC module only when it's required.
148
+ # See https://github.com/googleapis/toolkit/issues/446
149
+ require "gapic/grpc"
150
+ require "google/cloud/gaming/v1/realms_service_services_pb"
151
+
152
+ # Create the configuration object
153
+ @config = Configuration.new Client.configure
154
+
155
+ # Yield the configuration if needed
156
+ yield @config if block_given?
157
+
158
+ # Create credentials
159
+ credentials = @config.credentials
160
+ credentials ||= Credentials.default scope: @config.scope
161
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
162
+ credentials = Credentials.new credentials, scope: @config.scope
163
+ end
164
+ @quota_project_id = @config.quota_project
165
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
166
+
167
+ @operations_client = Operations.new do |config|
168
+ config.credentials = credentials
169
+ config.endpoint = @config.endpoint
170
+ end
171
+
172
+ @realms_service_stub = ::Gapic::ServiceStub.new(
173
+ ::Google::Cloud::Gaming::V1::RealmsService::Stub,
174
+ credentials: credentials,
175
+ endpoint: @config.endpoint,
176
+ channel_args: @config.channel_args,
177
+ interceptors: @config.interceptors
178
+ )
179
+ end
180
+
181
+ ##
182
+ # Get the associated client for long-running operations.
183
+ #
184
+ # @return [::Google::Cloud::Gaming::V1::RealmsService::Operations]
185
+ #
186
+ attr_reader :operations_client
187
+
188
+ # Service calls
189
+
190
+ ##
191
+ # Lists realms in a given project and location.
192
+ #
193
+ # @overload list_realms(request, options = nil)
194
+ # Pass arguments to `list_realms` via a request object, either of type
195
+ # {::Google::Cloud::Gaming::V1::ListRealmsRequest} or an equivalent Hash.
196
+ #
197
+ # @param request [::Google::Cloud::Gaming::V1::ListRealmsRequest, ::Hash]
198
+ # A request object representing the call parameters. Required. To specify no
199
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
200
+ # @param options [::Gapic::CallOptions, ::Hash]
201
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
202
+ #
203
+ # @overload list_realms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
204
+ # Pass arguments to `list_realms` via keyword arguments. Note that at
205
+ # least one keyword argument is required. To specify no parameters, or to keep all
206
+ # the default parameter values, pass an empty Hash as a request object (see above).
207
+ #
208
+ # @param parent [::String]
209
+ # Required. The parent resource name. Uses the form:
210
+ # `projects/{project}/locations/{location}`.
211
+ # @param page_size [::Integer]
212
+ # Optional. The maximum number of items to return. If unspecified, server
213
+ # will pick an appropriate default. Server may return fewer items than
214
+ # requested. A caller should only rely on response's
215
+ # {::Google::Cloud::Gaming::V1::ListRealmsResponse#next_page_token next_page_token} to
216
+ # determine if there are more realms left to be queried.
217
+ # @param page_token [::String]
218
+ # Optional. The next_page_token value returned from a previous List request,
219
+ # if any.
220
+ # @param filter [::String]
221
+ # Optional. The filter to apply to list results.
222
+ # @param order_by [::String]
223
+ # Optional. Specifies the ordering of results following syntax at
224
+ # https://cloud.google.com/apis/design/design_patterns#sorting_order.
225
+ #
226
+ # @yield [response, operation] Access the result along with the RPC operation
227
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>]
228
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
229
+ #
230
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>]
231
+ #
232
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
233
+ #
234
+ def list_realms request, options = nil
235
+ raise ::ArgumentError, "request must be provided" if request.nil?
236
+
237
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::ListRealmsRequest
238
+
239
+ # Converts hash and nil to an options object
240
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
241
+
242
+ # Customize the options with defaults
243
+ metadata = @config.rpcs.list_realms.metadata.to_h
244
+
245
+ # Set x-goog-api-client and x-goog-user-project headers
246
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
247
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
248
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION
249
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
250
+
251
+ header_params = {
252
+ "parent" => request.parent
253
+ }
254
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
255
+ metadata[:"x-goog-request-params"] ||= request_params_header
256
+
257
+ options.apply_defaults timeout: @config.rpcs.list_realms.timeout,
258
+ metadata: metadata,
259
+ retry_policy: @config.rpcs.list_realms.retry_policy
260
+ options.apply_defaults metadata: @config.metadata,
261
+ retry_policy: @config.retry_policy
262
+
263
+ @realms_service_stub.call_rpc :list_realms, request, options: options do |response, operation|
264
+ response = ::Gapic::PagedEnumerable.new @realms_service_stub, :list_realms, request, response, operation, options
265
+ yield response, operation if block_given?
266
+ return response
267
+ end
268
+ rescue ::GRPC::BadStatus => e
269
+ raise ::Google::Cloud::Error.from_error(e)
270
+ end
271
+
272
+ ##
273
+ # Gets details of a single realm.
274
+ #
275
+ # @overload get_realm(request, options = nil)
276
+ # Pass arguments to `get_realm` via a request object, either of type
277
+ # {::Google::Cloud::Gaming::V1::GetRealmRequest} or an equivalent Hash.
278
+ #
279
+ # @param request [::Google::Cloud::Gaming::V1::GetRealmRequest, ::Hash]
280
+ # A request object representing the call parameters. Required. To specify no
281
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
282
+ # @param options [::Gapic::CallOptions, ::Hash]
283
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
284
+ #
285
+ # @overload get_realm(name: nil)
286
+ # Pass arguments to `get_realm` via keyword arguments. Note that at
287
+ # least one keyword argument is required. To specify no parameters, or to keep all
288
+ # the default parameter values, pass an empty Hash as a request object (see above).
289
+ #
290
+ # @param name [::String]
291
+ # Required. The name of the realm to retrieve. Uses the form:
292
+ # `projects/{project}/locations/{location}/realms/{realm}`.
293
+ #
294
+ # @yield [response, operation] Access the result along with the RPC operation
295
+ # @yieldparam response [::Google::Cloud::Gaming::V1::Realm]
296
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
297
+ #
298
+ # @return [::Google::Cloud::Gaming::V1::Realm]
299
+ #
300
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
301
+ #
302
+ def get_realm request, options = nil
303
+ raise ::ArgumentError, "request must be provided" if request.nil?
304
+
305
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::GetRealmRequest
306
+
307
+ # Converts hash and nil to an options object
308
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
309
+
310
+ # Customize the options with defaults
311
+ metadata = @config.rpcs.get_realm.metadata.to_h
312
+
313
+ # Set x-goog-api-client and x-goog-user-project headers
314
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
315
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
316
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION
317
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
318
+
319
+ header_params = {
320
+ "name" => request.name
321
+ }
322
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
323
+ metadata[:"x-goog-request-params"] ||= request_params_header
324
+
325
+ options.apply_defaults timeout: @config.rpcs.get_realm.timeout,
326
+ metadata: metadata,
327
+ retry_policy: @config.rpcs.get_realm.retry_policy
328
+ options.apply_defaults metadata: @config.metadata,
329
+ retry_policy: @config.retry_policy
330
+
331
+ @realms_service_stub.call_rpc :get_realm, request, options: options do |response, operation|
332
+ yield response, operation if block_given?
333
+ return response
334
+ end
335
+ rescue ::GRPC::BadStatus => e
336
+ raise ::Google::Cloud::Error.from_error(e)
337
+ end
338
+
339
+ ##
340
+ # Creates a new realm in a given project and location.
341
+ #
342
+ # @overload create_realm(request, options = nil)
343
+ # Pass arguments to `create_realm` via a request object, either of type
344
+ # {::Google::Cloud::Gaming::V1::CreateRealmRequest} or an equivalent Hash.
345
+ #
346
+ # @param request [::Google::Cloud::Gaming::V1::CreateRealmRequest, ::Hash]
347
+ # A request object representing the call parameters. Required. To specify no
348
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
349
+ # @param options [::Gapic::CallOptions, ::Hash]
350
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
351
+ #
352
+ # @overload create_realm(parent: nil, realm_id: nil, realm: nil)
353
+ # Pass arguments to `create_realm` via keyword arguments. Note that at
354
+ # least one keyword argument is required. To specify no parameters, or to keep all
355
+ # the default parameter values, pass an empty Hash as a request object (see above).
356
+ #
357
+ # @param parent [::String]
358
+ # Required. The parent resource name. Uses the form:
359
+ # `projects/{project}/locations/{location}`.
360
+ # @param realm_id [::String]
361
+ # Required. The ID of the realm resource to be created.
362
+ # @param realm [::Google::Cloud::Gaming::V1::Realm, ::Hash]
363
+ # Required. The realm resource to be created.
364
+ #
365
+ # @yield [response, operation] Access the result along with the RPC operation
366
+ # @yieldparam response [::Gapic::Operation]
367
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
368
+ #
369
+ # @return [::Gapic::Operation]
370
+ #
371
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
372
+ #
373
+ def create_realm request, options = nil
374
+ raise ::ArgumentError, "request must be provided" if request.nil?
375
+
376
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::CreateRealmRequest
377
+
378
+ # Converts hash and nil to an options object
379
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
380
+
381
+ # Customize the options with defaults
382
+ metadata = @config.rpcs.create_realm.metadata.to_h
383
+
384
+ # Set x-goog-api-client and x-goog-user-project headers
385
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
386
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
387
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION
388
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
389
+
390
+ header_params = {
391
+ "parent" => request.parent
392
+ }
393
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
394
+ metadata[:"x-goog-request-params"] ||= request_params_header
395
+
396
+ options.apply_defaults timeout: @config.rpcs.create_realm.timeout,
397
+ metadata: metadata,
398
+ retry_policy: @config.rpcs.create_realm.retry_policy
399
+ options.apply_defaults metadata: @config.metadata,
400
+ retry_policy: @config.retry_policy
401
+
402
+ @realms_service_stub.call_rpc :create_realm, request, options: options do |response, operation|
403
+ response = ::Gapic::Operation.new response, @operations_client, options: options
404
+ yield response, operation if block_given?
405
+ return response
406
+ end
407
+ rescue ::GRPC::BadStatus => e
408
+ raise ::Google::Cloud::Error.from_error(e)
409
+ end
410
+
411
+ ##
412
+ # Deletes a single realm.
413
+ #
414
+ # @overload delete_realm(request, options = nil)
415
+ # Pass arguments to `delete_realm` via a request object, either of type
416
+ # {::Google::Cloud::Gaming::V1::DeleteRealmRequest} or an equivalent Hash.
417
+ #
418
+ # @param request [::Google::Cloud::Gaming::V1::DeleteRealmRequest, ::Hash]
419
+ # A request object representing the call parameters. Required. To specify no
420
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
421
+ # @param options [::Gapic::CallOptions, ::Hash]
422
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
423
+ #
424
+ # @overload delete_realm(name: nil)
425
+ # Pass arguments to `delete_realm` via keyword arguments. Note that at
426
+ # least one keyword argument is required. To specify no parameters, or to keep all
427
+ # the default parameter values, pass an empty Hash as a request object (see above).
428
+ #
429
+ # @param name [::String]
430
+ # Required. The name of the realm to delete. Uses the form:
431
+ # `projects/{project}/locations/{location}/realms/{realm}`.
432
+ #
433
+ # @yield [response, operation] Access the result along with the RPC operation
434
+ # @yieldparam response [::Gapic::Operation]
435
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
436
+ #
437
+ # @return [::Gapic::Operation]
438
+ #
439
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
440
+ #
441
+ def delete_realm request, options = nil
442
+ raise ::ArgumentError, "request must be provided" if request.nil?
443
+
444
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::DeleteRealmRequest
445
+
446
+ # Converts hash and nil to an options object
447
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
448
+
449
+ # Customize the options with defaults
450
+ metadata = @config.rpcs.delete_realm.metadata.to_h
451
+
452
+ # Set x-goog-api-client and x-goog-user-project headers
453
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
454
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
455
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION
456
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
457
+
458
+ header_params = {
459
+ "name" => request.name
460
+ }
461
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
462
+ metadata[:"x-goog-request-params"] ||= request_params_header
463
+
464
+ options.apply_defaults timeout: @config.rpcs.delete_realm.timeout,
465
+ metadata: metadata,
466
+ retry_policy: @config.rpcs.delete_realm.retry_policy
467
+ options.apply_defaults metadata: @config.metadata,
468
+ retry_policy: @config.retry_policy
469
+
470
+ @realms_service_stub.call_rpc :delete_realm, request, options: options do |response, operation|
471
+ response = ::Gapic::Operation.new response, @operations_client, options: options
472
+ yield response, operation if block_given?
473
+ return response
474
+ end
475
+ rescue ::GRPC::BadStatus => e
476
+ raise ::Google::Cloud::Error.from_error(e)
477
+ end
478
+
479
+ ##
480
+ # Patches a single realm.
481
+ #
482
+ # @overload update_realm(request, options = nil)
483
+ # Pass arguments to `update_realm` via a request object, either of type
484
+ # {::Google::Cloud::Gaming::V1::UpdateRealmRequest} or an equivalent Hash.
485
+ #
486
+ # @param request [::Google::Cloud::Gaming::V1::UpdateRealmRequest, ::Hash]
487
+ # A request object representing the call parameters. Required. To specify no
488
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
489
+ # @param options [::Gapic::CallOptions, ::Hash]
490
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
491
+ #
492
+ # @overload update_realm(realm: nil, update_mask: nil)
493
+ # Pass arguments to `update_realm` via keyword arguments. Note that at
494
+ # least one keyword argument is required. To specify no parameters, or to keep all
495
+ # the default parameter values, pass an empty Hash as a request object (see above).
496
+ #
497
+ # @param realm [::Google::Cloud::Gaming::V1::Realm, ::Hash]
498
+ # Required. The realm to be updated.
499
+ # Only fields specified in update_mask are updated.
500
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
501
+ # Required. The update mask applies to the resource. For the `FieldMask`
502
+ # definition, see
503
+ #
504
+ # https:
505
+ # //developers.google.com/protocol-buffers
506
+ # // /docs/reference/google.protobuf#fieldmask
507
+ #
508
+ # @yield [response, operation] Access the result along with the RPC operation
509
+ # @yieldparam response [::Gapic::Operation]
510
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
511
+ #
512
+ # @return [::Gapic::Operation]
513
+ #
514
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
515
+ #
516
+ def update_realm request, options = nil
517
+ raise ::ArgumentError, "request must be provided" if request.nil?
518
+
519
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::UpdateRealmRequest
520
+
521
+ # Converts hash and nil to an options object
522
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
523
+
524
+ # Customize the options with defaults
525
+ metadata = @config.rpcs.update_realm.metadata.to_h
526
+
527
+ # Set x-goog-api-client and x-goog-user-project headers
528
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
529
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
530
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION
531
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
532
+
533
+ header_params = {
534
+ "realm.name" => request.realm.name
535
+ }
536
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
537
+ metadata[:"x-goog-request-params"] ||= request_params_header
538
+
539
+ options.apply_defaults timeout: @config.rpcs.update_realm.timeout,
540
+ metadata: metadata,
541
+ retry_policy: @config.rpcs.update_realm.retry_policy
542
+ options.apply_defaults metadata: @config.metadata,
543
+ retry_policy: @config.retry_policy
544
+
545
+ @realms_service_stub.call_rpc :update_realm, request, options: options do |response, operation|
546
+ response = ::Gapic::Operation.new response, @operations_client, options: options
547
+ yield response, operation if block_given?
548
+ return response
549
+ end
550
+ rescue ::GRPC::BadStatus => e
551
+ raise ::Google::Cloud::Error.from_error(e)
552
+ end
553
+
554
+ ##
555
+ # Previews patches to a single realm.
556
+ #
557
+ # @overload preview_realm_update(request, options = nil)
558
+ # Pass arguments to `preview_realm_update` via a request object, either of type
559
+ # {::Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest} or an equivalent Hash.
560
+ #
561
+ # @param request [::Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest, ::Hash]
562
+ # A request object representing the call parameters. Required. To specify no
563
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
564
+ # @param options [::Gapic::CallOptions, ::Hash]
565
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
566
+ #
567
+ # @overload preview_realm_update(realm: nil, update_mask: nil, preview_time: nil)
568
+ # Pass arguments to `preview_realm_update` via keyword arguments. Note that at
569
+ # least one keyword argument is required. To specify no parameters, or to keep all
570
+ # the default parameter values, pass an empty Hash as a request object (see above).
571
+ #
572
+ # @param realm [::Google::Cloud::Gaming::V1::Realm, ::Hash]
573
+ # Required. The realm to be updated.
574
+ # Only fields specified in update_mask are updated.
575
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
576
+ # Required. The update mask applies to the resource. For the `FieldMask`
577
+ # definition, see
578
+ #
579
+ # https:
580
+ # //developers.google.com/protocol-buffers
581
+ # // /docs/reference/google.protobuf#fieldmask
582
+ # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
583
+ # Optional. The target timestamp to compute the preview.
584
+ #
585
+ # @yield [response, operation] Access the result along with the RPC operation
586
+ # @yieldparam response [::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse]
587
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
588
+ #
589
+ # @return [::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse]
590
+ #
591
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
592
+ #
593
+ def preview_realm_update request, options = nil
594
+ raise ::ArgumentError, "request must be provided" if request.nil?
595
+
596
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest
597
+
598
+ # Converts hash and nil to an options object
599
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
600
+
601
+ # Customize the options with defaults
602
+ metadata = @config.rpcs.preview_realm_update.metadata.to_h
603
+
604
+ # Set x-goog-api-client and x-goog-user-project headers
605
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
606
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
607
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION
608
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
609
+
610
+ header_params = {
611
+ "realm.name" => request.realm.name
612
+ }
613
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
614
+ metadata[:"x-goog-request-params"] ||= request_params_header
615
+
616
+ options.apply_defaults timeout: @config.rpcs.preview_realm_update.timeout,
617
+ metadata: metadata,
618
+ retry_policy: @config.rpcs.preview_realm_update.retry_policy
619
+ options.apply_defaults metadata: @config.metadata,
620
+ retry_policy: @config.retry_policy
621
+
622
+ @realms_service_stub.call_rpc :preview_realm_update, request, options: options do |response, operation|
623
+ yield response, operation if block_given?
624
+ return response
625
+ end
626
+ rescue ::GRPC::BadStatus => e
627
+ raise ::Google::Cloud::Error.from_error(e)
628
+ end
629
+
630
+ ##
631
+ # Configuration class for the RealmsService API.
632
+ #
633
+ # This class represents the configuration for RealmsService,
634
+ # providing control over timeouts, retry behavior, logging, transport
635
+ # parameters, and other low-level controls. Certain parameters can also be
636
+ # applied individually to specific RPCs. See
637
+ # {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration::Rpcs}
638
+ # for a list of RPCs that can be configured independently.
639
+ #
640
+ # Configuration can be applied globally to all clients, or to a single client
641
+ # on construction.
642
+ #
643
+ # # Examples
644
+ #
645
+ # To modify the global config, setting the timeout for list_realms
646
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
647
+ #
648
+ # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
649
+ # config.timeout = 10.0
650
+ # config.rpcs.list_realms.timeout = 20.0
651
+ # end
652
+ #
653
+ # To apply the above configuration only to a new client:
654
+ #
655
+ # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
656
+ # config.timeout = 10.0
657
+ # config.rpcs.list_realms.timeout = 20.0
658
+ # end
659
+ #
660
+ # @!attribute [rw] endpoint
661
+ # The hostname or hostname:port of the service endpoint.
662
+ # Defaults to `"gameservices.googleapis.com"`.
663
+ # @return [::String]
664
+ # @!attribute [rw] credentials
665
+ # Credentials to send with calls. You may provide any of the following types:
666
+ # * (`String`) The path to a service account key file in JSON format
667
+ # * (`Hash`) A service account key as a Hash
668
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
669
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
670
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
671
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
672
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
673
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
674
+ # * (`nil`) indicating no credentials
675
+ # @return [::Object]
676
+ # @!attribute [rw] scope
677
+ # The OAuth scopes
678
+ # @return [::Array<::String>]
679
+ # @!attribute [rw] lib_name
680
+ # The library name as recorded in instrumentation and logging
681
+ # @return [::String]
682
+ # @!attribute [rw] lib_version
683
+ # The library version as recorded in instrumentation and logging
684
+ # @return [::String]
685
+ # @!attribute [rw] channel_args
686
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
687
+ # `GRPC::Core::Channel` object is provided as the credential.
688
+ # @return [::Hash]
689
+ # @!attribute [rw] interceptors
690
+ # An array of interceptors that are run before calls are executed.
691
+ # @return [::Array<::GRPC::ClientInterceptor>]
692
+ # @!attribute [rw] timeout
693
+ # The call timeout in seconds.
694
+ # @return [::Numeric]
695
+ # @!attribute [rw] metadata
696
+ # Additional gRPC headers to be sent with the call.
697
+ # @return [::Hash{::Symbol=>::String}]
698
+ # @!attribute [rw] retry_policy
699
+ # The retry policy. The value is a hash with the following keys:
700
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
701
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
702
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
703
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
704
+ # trigger a retry.
705
+ # @return [::Hash]
706
+ # @!attribute [rw] quota_project
707
+ # A separate project against which to charge quota.
708
+ # @return [::String]
709
+ #
710
+ class Configuration
711
+ extend ::Gapic::Config
712
+
713
+ config_attr :endpoint, "gameservices.googleapis.com", ::String
714
+ config_attr :credentials, nil do |value|
715
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
716
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
717
+ allowed.any? { |klass| klass === value }
718
+ end
719
+ config_attr :scope, nil, ::String, ::Array, nil
720
+ config_attr :lib_name, nil, ::String, nil
721
+ config_attr :lib_version, nil, ::String, nil
722
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
723
+ config_attr :interceptors, nil, ::Array, nil
724
+ config_attr :timeout, nil, ::Numeric, nil
725
+ config_attr :metadata, nil, ::Hash, nil
726
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
727
+ config_attr :quota_project, nil, ::String, nil
728
+
729
+ # @private
730
+ def initialize parent_config = nil
731
+ @parent_config = parent_config unless parent_config.nil?
732
+
733
+ yield self if block_given?
734
+ end
735
+
736
+ ##
737
+ # Configurations for individual RPCs
738
+ # @return [Rpcs]
739
+ #
740
+ def rpcs
741
+ @rpcs ||= begin
742
+ parent_rpcs = nil
743
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
744
+ Rpcs.new parent_rpcs
745
+ end
746
+ end
747
+
748
+ ##
749
+ # Configuration RPC class for the RealmsService API.
750
+ #
751
+ # Includes fields providing the configuration for each RPC in this service.
752
+ # Each configuration object is of type `Gapic::Config::Method` and includes
753
+ # the following configuration fields:
754
+ #
755
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
756
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
757
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
758
+ # include the following keys:
759
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
760
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
761
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
762
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
763
+ # trigger a retry.
764
+ #
765
+ class Rpcs
766
+ ##
767
+ # RPC-specific configuration for `list_realms`
768
+ # @return [::Gapic::Config::Method]
769
+ #
770
+ attr_reader :list_realms
771
+ ##
772
+ # RPC-specific configuration for `get_realm`
773
+ # @return [::Gapic::Config::Method]
774
+ #
775
+ attr_reader :get_realm
776
+ ##
777
+ # RPC-specific configuration for `create_realm`
778
+ # @return [::Gapic::Config::Method]
779
+ #
780
+ attr_reader :create_realm
781
+ ##
782
+ # RPC-specific configuration for `delete_realm`
783
+ # @return [::Gapic::Config::Method]
784
+ #
785
+ attr_reader :delete_realm
786
+ ##
787
+ # RPC-specific configuration for `update_realm`
788
+ # @return [::Gapic::Config::Method]
789
+ #
790
+ attr_reader :update_realm
791
+ ##
792
+ # RPC-specific configuration for `preview_realm_update`
793
+ # @return [::Gapic::Config::Method]
794
+ #
795
+ attr_reader :preview_realm_update
796
+
797
+ # @private
798
+ def initialize parent_rpcs = nil
799
+ list_realms_config = parent_rpcs&.list_realms if parent_rpcs&.respond_to? :list_realms
800
+ @list_realms = ::Gapic::Config::Method.new list_realms_config
801
+ get_realm_config = parent_rpcs&.get_realm if parent_rpcs&.respond_to? :get_realm
802
+ @get_realm = ::Gapic::Config::Method.new get_realm_config
803
+ create_realm_config = parent_rpcs&.create_realm if parent_rpcs&.respond_to? :create_realm
804
+ @create_realm = ::Gapic::Config::Method.new create_realm_config
805
+ delete_realm_config = parent_rpcs&.delete_realm if parent_rpcs&.respond_to? :delete_realm
806
+ @delete_realm = ::Gapic::Config::Method.new delete_realm_config
807
+ update_realm_config = parent_rpcs&.update_realm if parent_rpcs&.respond_to? :update_realm
808
+ @update_realm = ::Gapic::Config::Method.new update_realm_config
809
+ preview_realm_update_config = parent_rpcs&.preview_realm_update if parent_rpcs&.respond_to? :preview_realm_update
810
+ @preview_realm_update = ::Gapic::Config::Method.new preview_realm_update_config
811
+
812
+ yield self if block_given?
813
+ end
814
+ end
815
+ end
816
+ end
817
+ end
818
+ end
819
+ end
820
+ end
821
+ end