google-cloud-memcache-v1beta2 0.1.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -82,7 +82,7 @@ module Google
82
82
  # Create credentials
83
83
  credentials = @config.credentials
84
84
  credentials ||= Credentials.default scope: @config.scope
85
- if credentials.is_a?(String) || credentials.is_a?(Hash)
85
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
88
  @quota_project_id = @config.quota_project
@@ -103,8 +103,13 @@ module Google
103
103
  # Lists operations that match the specified filter in the request. If the
104
104
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
105
105
  #
106
- # NOTE: the `name` binding below allows API services to override the binding
107
- # to use different resource name schemes, such as `users/*/operations`.
106
+ # NOTE: the `name` binding allows API services to override the binding
107
+ # to use different resource name schemes, such as `users/*/operations`. To
108
+ # override the binding, API services can add a binding such as
109
+ # `"/v1/{name=users/*}/operations"` to their service configuration.
110
+ # For backwards compatibility, the default name includes the operations
111
+ # collection id, however overriding users must ensure the name binding
112
+ # is the parent resource, without the operations collection id.
108
113
  #
109
114
  # @overload list_operations(request, options = nil)
110
115
  # Pass arguments to `list_operations` via a request object, either of type
@@ -122,7 +127,7 @@ module Google
122
127
  # the default parameter values, pass an empty Hash as a request object (see above).
123
128
  #
124
129
  # @param name [::String]
125
- # The name of the operation collection.
130
+ # The name of the operation's parent resource.
126
131
  # @param filter [::String]
127
132
  # The standard list filter.
128
133
  # @param page_size [::Integer]
@@ -164,7 +169,9 @@ module Google
164
169
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
165
170
  metadata: metadata,
166
171
  retry_policy: @config.rpcs.list_operations.retry_policy
167
- options.apply_defaults metadata: @config.metadata,
172
+
173
+ options.apply_defaults timeout: @config.timeout,
174
+ metadata: @config.metadata,
168
175
  retry_policy: @config.retry_policy
169
176
 
170
177
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
@@ -234,7 +241,9 @@ module Google
234
241
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
235
242
  metadata: metadata,
236
243
  retry_policy: @config.rpcs.get_operation.retry_policy
237
- options.apply_defaults metadata: @config.metadata,
244
+
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata,
238
247
  retry_policy: @config.retry_policy
239
248
 
240
249
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
@@ -304,7 +313,9 @@ module Google
304
313
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
305
314
  metadata: metadata,
306
315
  retry_policy: @config.rpcs.delete_operation.retry_policy
307
- options.apply_defaults metadata: @config.metadata,
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
308
319
  retry_policy: @config.retry_policy
309
320
 
310
321
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
@@ -379,7 +390,9 @@ module Google
379
390
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
380
391
  metadata: metadata,
381
392
  retry_policy: @config.rpcs.cancel_operation.retry_policy
382
- options.apply_defaults metadata: @config.metadata,
393
+
394
+ options.apply_defaults timeout: @config.timeout,
395
+ metadata: @config.metadata,
383
396
  retry_policy: @config.retry_policy
384
397
 
385
398
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
@@ -390,6 +403,81 @@ module Google
390
403
  raise ::Google::Cloud::Error.from_error(e)
391
404
  end
392
405
 
406
+ ##
407
+ # Waits until the specified long-running operation is done or reaches at most
408
+ # a specified timeout, returning the latest state. If the operation is
409
+ # already done, the latest state is immediately returned. If the timeout
410
+ # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
411
+ # timeout is used. If the server does not support this method, it returns
412
+ # `google.rpc.Code.UNIMPLEMENTED`.
413
+ # Note that this method is on a best-effort basis. It may return the latest
414
+ # state before the specified timeout (including immediately), meaning even an
415
+ # immediate response is no guarantee that the operation is done.
416
+ #
417
+ # @overload wait_operation(request, options = nil)
418
+ # Pass arguments to `wait_operation` via a request object, either of type
419
+ # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
420
+ #
421
+ # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
422
+ # A request object representing the call parameters. Required. To specify no
423
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
424
+ # @param options [::Gapic::CallOptions, ::Hash]
425
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
426
+ #
427
+ # @overload wait_operation(name: nil, timeout: nil)
428
+ # Pass arguments to `wait_operation` via keyword arguments. Note that at
429
+ # least one keyword argument is required. To specify no parameters, or to keep all
430
+ # the default parameter values, pass an empty Hash as a request object (see above).
431
+ #
432
+ # @param name [::String]
433
+ # The name of the operation resource to wait on.
434
+ # @param timeout [::Google::Protobuf::Duration, ::Hash]
435
+ # The maximum duration to wait before timing out. If left blank, the wait
436
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
437
+ # If RPC context deadline is also specified, the shorter one will be used.
438
+ #
439
+ # @yield [response, operation] Access the result along with the RPC operation
440
+ # @yieldparam response [::Gapic::Operation]
441
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
442
+ #
443
+ # @return [::Gapic::Operation]
444
+ #
445
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
+ #
447
+ def wait_operation request, options = nil
448
+ raise ::ArgumentError, "request must be provided" if request.nil?
449
+
450
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
451
+
452
+ # Converts hash and nil to an options object
453
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
454
+
455
+ # Customize the options with defaults
456
+ metadata = @config.rpcs.wait_operation.metadata.to_h
457
+
458
+ # Set x-goog-api-client and x-goog-user-project headers
459
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
460
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
461
+ gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION
462
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
463
+
464
+ options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
465
+ metadata: metadata,
466
+ retry_policy: @config.rpcs.wait_operation.retry_policy
467
+
468
+ options.apply_defaults timeout: @config.timeout,
469
+ metadata: @config.metadata,
470
+ retry_policy: @config.retry_policy
471
+
472
+ @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
473
+ response = ::Gapic::Operation.new response, @operations_client, options: options
474
+ yield response, operation if block_given?
475
+ return response
476
+ end
477
+ rescue ::GRPC::BadStatus => e
478
+ raise ::Google::Cloud::Error.from_error(e)
479
+ end
480
+
393
481
  ##
394
482
  # Configuration class for the Operations API.
395
483
  #
@@ -403,22 +491,21 @@ module Google
403
491
  # Configuration can be applied globally to all clients, or to a single client
404
492
  # on construction.
405
493
  #
406
- # # Examples
407
- #
408
- # To modify the global config, setting the timeout for list_operations
409
- # to 20 seconds, and all remaining timeouts to 10 seconds:
410
- #
411
- # ::Google::Longrunning::Operations::Client.configure do |config|
412
- # config.timeout = 10.0
413
- # config.rpcs.list_operations.timeout = 20.0
414
- # end
494
+ # @example
415
495
  #
416
- # To apply the above configuration only to a new client:
496
+ # # Modify the global config, setting the timeout for
497
+ # # list_operations to 20 seconds,
498
+ # # and all remaining timeouts to 10 seconds.
499
+ # ::Google::Longrunning::Operations::Client.configure do |config|
500
+ # config.timeout = 10.0
501
+ # config.rpcs.list_operations.timeout = 20.0
502
+ # end
417
503
  #
418
- # client = ::Google::Longrunning::Operations::Client.new do |config|
419
- # config.timeout = 10.0
420
- # config.rpcs.list_operations.timeout = 20.0
421
- # end
504
+ # # Apply the above configuration only to a new client.
505
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
506
+ # config.timeout = 10.0
507
+ # config.rpcs.list_operations.timeout = 20.0
508
+ # end
422
509
  #
423
510
  # @!attribute [rw] endpoint
424
511
  # The hostname or hostname:port of the service endpoint.
@@ -475,14 +562,14 @@ module Google
475
562
 
476
563
  config_attr :endpoint, "memcache.googleapis.com", ::String
477
564
  config_attr :credentials, nil do |value|
478
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
565
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
479
566
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
480
567
  allowed.any? { |klass| klass === value }
481
568
  end
482
569
  config_attr :scope, nil, ::String, ::Array, nil
483
570
  config_attr :lib_name, nil, ::String, nil
484
571
  config_attr :lib_version, nil, ::String, nil
485
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
572
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
486
573
  config_attr :interceptors, nil, ::Array, nil
487
574
  config_attr :timeout, nil, ::Numeric, nil
488
575
  config_attr :metadata, nil, ::Hash, nil
@@ -503,7 +590,7 @@ module Google
503
590
  def rpcs
504
591
  @rpcs ||= begin
505
592
  parent_rpcs = nil
506
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
593
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
507
594
  Rpcs.new parent_rpcs
508
595
  end
509
596
  end
@@ -515,7 +602,7 @@ module Google
515
602
  # Each configuration object is of type `Gapic::Config::Method` and includes
516
603
  # the following configuration fields:
517
604
  #
518
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
605
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
519
606
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
520
607
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
521
608
  # include the following keys:
@@ -546,17 +633,24 @@ module Google
546
633
  # @return [::Gapic::Config::Method]
547
634
  #
548
635
  attr_reader :cancel_operation
636
+ ##
637
+ # RPC-specific configuration for `wait_operation`
638
+ # @return [::Gapic::Config::Method]
639
+ #
640
+ attr_reader :wait_operation
549
641
 
550
642
  # @private
551
643
  def initialize parent_rpcs = nil
552
- list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
644
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
553
645
  @list_operations = ::Gapic::Config::Method.new list_operations_config
554
- get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
646
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
555
647
  @get_operation = ::Gapic::Config::Method.new get_operation_config
556
- delete_operation_config = parent_rpcs&.delete_operation if parent_rpcs&.respond_to? :delete_operation
648
+ delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
557
649
  @delete_operation = ::Gapic::Config::Method.new delete_operation_config
558
- cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
650
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
559
651
  @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
652
+ wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
653
+ @wait_operation = ::Gapic::Config::Method.new wait_operation_config
560
654
 
561
655
  yield self if block_given?
562
656
  end
@@ -29,6 +29,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
29
29
  optional :memcache_full_version, :string, 18
30
30
  repeated :instance_messages, :message, 19, "google.cloud.memcache.v1beta2.Instance.InstanceMessage"
31
31
  optional :discovery_endpoint, :string, 20
32
+ optional :update_available, :bool, 21
32
33
  end
33
34
  add_message "google.cloud.memcache.v1beta2.Instance.NodeConfig" do
34
35
  optional :cpu_count, :int32, 1
@@ -41,6 +42,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
41
42
  optional :host, :string, 4
42
43
  optional :port, :int32, 5
43
44
  optional :parameters, :message, 6, "google.cloud.memcache.v1beta2.MemcacheParameters"
45
+ optional :update_available, :bool, 7
44
46
  end
45
47
  add_enum "google.cloud.memcache.v1beta2.Instance.Node.State" do
46
48
  value :STATE_UNSPECIFIED, 0
@@ -101,6 +103,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
101
103
  optional :update_mask, :message, 2, "google.protobuf.FieldMask"
102
104
  optional :parameters, :message, 3, "google.cloud.memcache.v1beta2.MemcacheParameters"
103
105
  end
106
+ add_message "google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest" do
107
+ optional :instance, :string, 1
108
+ repeated :node_ids, :string, 2
109
+ optional :apply_all, :bool, 3
110
+ end
104
111
  add_message "google.cloud.memcache.v1beta2.MemcacheParameters" do
105
112
  optional :id, :string, 1
106
113
  map :params, :string, :string, 3
@@ -145,6 +152,7 @@ module Google
145
152
  DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.DeleteInstanceRequest").msgclass
146
153
  ApplyParametersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.ApplyParametersRequest").msgclass
147
154
  UpdateParametersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.UpdateParametersRequest").msgclass
155
+ ApplySoftwareUpdateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest").msgclass
148
156
  MemcacheParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.MemcacheParameters").msgclass
149
157
  OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.OperationMetadata").msgclass
150
158
  LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.LocationMetadata").msgclass
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/memcache/v1beta2/cloud_memcache.proto for package 'google.cloud.memcache.v1beta2'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2021 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
  require 'grpc'
21
20
  require 'google/cloud/memcache/v1beta2/cloud_memcache_pb'
@@ -38,7 +37,7 @@ module Google
38
37
  # * As such, Memcached instances are resources of the form:
39
38
  # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
40
39
  #
41
- # Note that location_id must be refering to a GCP `region`; for example:
40
+ # Note that location_id must be a GCP `region`; for example:
42
41
  # * `projects/my-memcached-project/locations/us-central1/instances/my-memcached`
43
42
  class Service
44
43
 
@@ -48,23 +47,26 @@ module Google
48
47
  self.unmarshal_class_method = :decode
49
48
  self.service_name = 'google.cloud.memcache.v1beta2.CloudMemcache'
50
49
 
51
- # Lists Instances in a given project and location.
52
- rpc :ListInstances, Google::Cloud::Memcache::V1beta2::ListInstancesRequest, Google::Cloud::Memcache::V1beta2::ListInstancesResponse
50
+ # Lists Instances in a given location.
51
+ rpc :ListInstances, ::Google::Cloud::Memcache::V1beta2::ListInstancesRequest, ::Google::Cloud::Memcache::V1beta2::ListInstancesResponse
53
52
  # Gets details of a single Instance.
54
- rpc :GetInstance, Google::Cloud::Memcache::V1beta2::GetInstanceRequest, Google::Cloud::Memcache::V1beta2::Instance
55
- # Creates a new Instance in a given project and location.
56
- rpc :CreateInstance, Google::Cloud::Memcache::V1beta2::CreateInstanceRequest, Google::Longrunning::Operation
53
+ rpc :GetInstance, ::Google::Cloud::Memcache::V1beta2::GetInstanceRequest, ::Google::Cloud::Memcache::V1beta2::Instance
54
+ # Creates a new Instance in a given location.
55
+ rpc :CreateInstance, ::Google::Cloud::Memcache::V1beta2::CreateInstanceRequest, ::Google::Longrunning::Operation
57
56
  # Updates an existing Instance in a given project and location.
58
- rpc :UpdateInstance, Google::Cloud::Memcache::V1beta2::UpdateInstanceRequest, Google::Longrunning::Operation
59
- # Updates the defined Memcached Parameters for an existing Instance.
57
+ rpc :UpdateInstance, ::Google::Cloud::Memcache::V1beta2::UpdateInstanceRequest, ::Google::Longrunning::Operation
58
+ # Updates the defined Memcached parameters for an existing instance.
60
59
  # This method only stages the parameters, it must be followed by
61
- # ApplyParameters to apply the parameters to nodes of the Memcached Instance.
62
- rpc :UpdateParameters, Google::Cloud::Memcache::V1beta2::UpdateParametersRequest, Google::Longrunning::Operation
60
+ # `ApplyParameters` to apply the parameters to nodes of the Memcached
61
+ # instance.
62
+ rpc :UpdateParameters, ::Google::Cloud::Memcache::V1beta2::UpdateParametersRequest, ::Google::Longrunning::Operation
63
63
  # Deletes a single Instance.
64
- rpc :DeleteInstance, Google::Cloud::Memcache::V1beta2::DeleteInstanceRequest, Google::Longrunning::Operation
65
- # ApplyParameters will update current set of Parameters to the set of
66
- # specified nodes of the Memcached Instance.
67
- rpc :ApplyParameters, Google::Cloud::Memcache::V1beta2::ApplyParametersRequest, Google::Longrunning::Operation
64
+ rpc :DeleteInstance, ::Google::Cloud::Memcache::V1beta2::DeleteInstanceRequest, ::Google::Longrunning::Operation
65
+ # `ApplyParameters` restarts the set of specified nodes in order to update
66
+ # them to the current set of parameters for the Memcached Instance.
67
+ rpc :ApplyParameters, ::Google::Cloud::Memcache::V1beta2::ApplyParametersRequest, ::Google::Longrunning::Operation
68
+ # Updates software on the selected nodes of the Instance.
69
+ rpc :ApplySoftwareUpdate, ::Google::Cloud::Memcache::V1beta2::ApplySoftwareUpdateRequest, ::Google::Longrunning::Operation
68
70
  end
69
71
 
70
72
  Stub = Service.rpc_stub_class
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Memcache
23
23
  module V1beta2
24
- VERSION = "0.1.2"
24
+ VERSION = "0.2.3"
25
25
  end
26
26
  end
27
27
  end
@@ -54,6 +54,18 @@ module Google
54
54
  # This indicates that the field may be set once in a request to create a
55
55
  # resource, but may not be changed thereafter.
56
56
  IMMUTABLE = 5
57
+
58
+ # Denotes that a (repeated) field is an unordered list.
59
+ # This indicates that the service may provide the elements of the list
60
+ # in any arbitrary order, rather than the order the user originally
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
57
69
  end
58
70
  end
59
71
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
46
- # resources:
47
- # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/\\{project}/topics/\\{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/\\{project}"
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/{project}/topics/{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/{project}"
52
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
185
  # @return [::String]
186
- # The plural name used in the resource name, such as 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods