diff --git a/google-cloud-gke_hub-v1/.owlbot-manifest.json b/google-cloud-gke_hub-v1/.owlbot-manifest.json index 37612b16179f..c108dedb77e6 100644 --- a/google-cloud-gke_hub-v1/.owlbot-manifest.json +++ b/google-cloud-gke_hub-v1/.owlbot-manifest.json @@ -26,10 +26,9 @@ "lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb", "lib/google/cloud/gke_hub/v1/rest.rb", "lib/google/cloud/gke_hub/v1/version.rb", - "lib/google/cloud/gkehub/v1/configmanagement/configmanagement_pb.rb", "lib/google/cloud/gkehub/v1/feature_pb.rb", + "lib/google/cloud/gkehub/v1/fleet_pb.rb", "lib/google/cloud/gkehub/v1/membership_pb.rb", - "lib/google/cloud/gkehub/v1/multiclusteringress/multiclusteringress_pb.rb", "lib/google/cloud/gkehub/v1/service_pb.rb", "lib/google/cloud/gkehub/v1/service_services_pb.rb", "proto_docs/README.md", @@ -39,8 +38,10 @@ "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/gkehub/v1/configmanagement/configmanagement.rb", "proto_docs/google/cloud/gkehub/v1/feature.rb", + "proto_docs/google/cloud/gkehub/v1/fleet.rb", "proto_docs/google/cloud/gkehub/v1/membership.rb", "proto_docs/google/cloud/gkehub/v1/multiclusteringress/multiclusteringress.rb", + "proto_docs/google/cloud/gkehub/v1/rbacrolebindingactuation/rbacrolebindingactuation.rb", "proto_docs/google/cloud/gkehub/v1/service.rb", "proto_docs/google/longrunning/operations.rb", "proto_docs/google/protobuf/any.rb", @@ -51,16 +52,49 @@ "proto_docs/google/rpc/status.rb", "snippets/Gemfile", "snippets/gke_hub/create_feature.rb", + "snippets/gke_hub/create_fleet.rb", "snippets/gke_hub/create_membership.rb", + "snippets/gke_hub/create_membership_binding.rb", + "snippets/gke_hub/create_membership_rbac_role_binding.rb", + "snippets/gke_hub/create_scope.rb", + "snippets/gke_hub/create_scope_namespace.rb", + "snippets/gke_hub/create_scope_rbac_role_binding.rb", "snippets/gke_hub/delete_feature.rb", + "snippets/gke_hub/delete_fleet.rb", "snippets/gke_hub/delete_membership.rb", + "snippets/gke_hub/delete_membership_binding.rb", + "snippets/gke_hub/delete_membership_rbac_role_binding.rb", + "snippets/gke_hub/delete_scope.rb", + "snippets/gke_hub/delete_scope_namespace.rb", + "snippets/gke_hub/delete_scope_rbac_role_binding.rb", "snippets/gke_hub/generate_connect_manifest.rb", + "snippets/gke_hub/generate_membership_rbac_role_binding_yaml.rb", "snippets/gke_hub/get_feature.rb", + "snippets/gke_hub/get_fleet.rb", "snippets/gke_hub/get_membership.rb", + "snippets/gke_hub/get_membership_binding.rb", + "snippets/gke_hub/get_membership_rbac_role_binding.rb", + "snippets/gke_hub/get_scope.rb", + "snippets/gke_hub/get_scope_namespace.rb", + "snippets/gke_hub/get_scope_rbac_role_binding.rb", + "snippets/gke_hub/list_bound_memberships.rb", "snippets/gke_hub/list_features.rb", + "snippets/gke_hub/list_fleets.rb", + "snippets/gke_hub/list_membership_bindings.rb", + "snippets/gke_hub/list_membership_rbac_role_bindings.rb", "snippets/gke_hub/list_memberships.rb", + "snippets/gke_hub/list_permitted_scopes.rb", + "snippets/gke_hub/list_scope_namespaces.rb", + "snippets/gke_hub/list_scope_rbac_role_bindings.rb", + "snippets/gke_hub/list_scopes.rb", "snippets/gke_hub/update_feature.rb", + "snippets/gke_hub/update_fleet.rb", "snippets/gke_hub/update_membership.rb", + "snippets/gke_hub/update_membership_binding.rb", + "snippets/gke_hub/update_membership_rbac_role_binding.rb", + "snippets/gke_hub/update_scope.rb", + "snippets/gke_hub/update_scope_namespace.rb", + "snippets/gke_hub/update_scope_rbac_role_binding.rb", "snippets/snippet_metadata_google.cloud.gkehub.v1.json", "test/google/cloud/gke_hub/v1/gke_hub_operations_test.rb", "test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb", diff --git a/google-cloud-gke_hub-v1/gapic_metadata.json b/google-cloud-gke_hub-v1/gapic_metadata.json index a08fd656a3eb..60141aebea27 100644 --- a/google-cloud-gke_hub-v1/gapic_metadata.json +++ b/google-cloud-gke_hub-v1/gapic_metadata.json @@ -15,6 +15,11 @@ "list_memberships" ] }, + "ListBoundMemberships": { + "methods": [ + "list_bound_memberships" + ] + }, "ListFeatures": { "methods": [ "list_features" @@ -64,6 +69,166 @@ "methods": [ "generate_connect_manifest" ] + }, + "CreateFleet": { + "methods": [ + "create_fleet" + ] + }, + "GetFleet": { + "methods": [ + "get_fleet" + ] + }, + "UpdateFleet": { + "methods": [ + "update_fleet" + ] + }, + "DeleteFleet": { + "methods": [ + "delete_fleet" + ] + }, + "ListFleets": { + "methods": [ + "list_fleets" + ] + }, + "GetScopeNamespace": { + "methods": [ + "get_scope_namespace" + ] + }, + "CreateScopeNamespace": { + "methods": [ + "create_scope_namespace" + ] + }, + "UpdateScopeNamespace": { + "methods": [ + "update_scope_namespace" + ] + }, + "DeleteScopeNamespace": { + "methods": [ + "delete_scope_namespace" + ] + }, + "ListScopeNamespaces": { + "methods": [ + "list_scope_namespaces" + ] + }, + "GetScopeRBACRoleBinding": { + "methods": [ + "get_scope_rbac_role_binding" + ] + }, + "CreateScopeRBACRoleBinding": { + "methods": [ + "create_scope_rbac_role_binding" + ] + }, + "UpdateScopeRBACRoleBinding": { + "methods": [ + "update_scope_rbac_role_binding" + ] + }, + "DeleteScopeRBACRoleBinding": { + "methods": [ + "delete_scope_rbac_role_binding" + ] + }, + "ListScopeRBACRoleBindings": { + "methods": [ + "list_scope_rbac_role_bindings" + ] + }, + "GetScope": { + "methods": [ + "get_scope" + ] + }, + "CreateScope": { + "methods": [ + "create_scope" + ] + }, + "UpdateScope": { + "methods": [ + "update_scope" + ] + }, + "DeleteScope": { + "methods": [ + "delete_scope" + ] + }, + "ListScopes": { + "methods": [ + "list_scopes" + ] + }, + "ListPermittedScopes": { + "methods": [ + "list_permitted_scopes" + ] + }, + "GetMembershipBinding": { + "methods": [ + "get_membership_binding" + ] + }, + "CreateMembershipBinding": { + "methods": [ + "create_membership_binding" + ] + }, + "UpdateMembershipBinding": { + "methods": [ + "update_membership_binding" + ] + }, + "DeleteMembershipBinding": { + "methods": [ + "delete_membership_binding" + ] + }, + "ListMembershipBindings": { + "methods": [ + "list_membership_bindings" + ] + }, + "GetMembershipRBACRoleBinding": { + "methods": [ + "get_membership_rbac_role_binding" + ] + }, + "CreateMembershipRBACRoleBinding": { + "methods": [ + "create_membership_rbac_role_binding" + ] + }, + "UpdateMembershipRBACRoleBinding": { + "methods": [ + "update_membership_rbac_role_binding" + ] + }, + "DeleteMembershipRBACRoleBinding": { + "methods": [ + "delete_membership_rbac_role_binding" + ] + }, + "ListMembershipRBACRoleBindings": { + "methods": [ + "list_membership_rbac_role_bindings" + ] + }, + "GenerateMembershipRBACRoleBindingYAML": { + "methods": [ + "generate_membership_rbac_role_binding_yaml" + ] } } } diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/client.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/client.rb index 00a5af98d9e8..182580814413 100644 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/client.rb +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/client.rb @@ -343,6 +343,113 @@ def list_memberships request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Lists Memberships bound to a Scope. The response includes relevant + # Memberships from all regions. + # + # @overload list_bound_memberships(request, options = nil) + # Pass arguments to `list_bound_memberships` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_bound_memberships(scope_name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_bound_memberships` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param scope_name [::String] + # Required. Name of the Scope, in the format + # `projects/*/locations/global/scopes/*`, to which the Memberships are bound. + # @param filter [::String] + # Optional. Lists Memberships that match the filter expression, following the + # syntax outlined in https://google.aip.dev/160. Currently, filtering + # can be done only based on Memberships's `name`, `labels`, `create_time`, + # `update_time`, and `unique_id`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. Pagination is currently not supported; therefore, setting + # this field does not have any impact for now. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListBoundMemberships` which + # specifies the position in the list from where to continue listing the + # resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Membership>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Membership>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest.new + # + # # Call the list_bound_memberships method. + # result = client.list_bound_memberships request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Membership. + # p item + # end + # + def list_bound_memberships request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_bound_memberships.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.scope_name + header_params["scope_name"] = request.scope_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_bound_memberships.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_bound_memberships.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :list_bound_memberships, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_bound_memberships, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Lists Features in a given project and location. # @@ -356,7 +463,7 @@ def list_memberships request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload list_features(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # @overload list_features(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, return_partial_success: nil) # Pass arguments to `list_features` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -392,6 +499,11 @@ def list_memberships request, options = nil # @param order_by [::String] # One or more fields to compare and use to sort the output. # See https://google.aip.dev/132#ordering. + # @param return_partial_success [::Boolean] + # Optional. If set to true, the response will return partial results when + # some regions are unreachable and the unreachable field in Feature proto + # will be populated. If set to false, the request will fail when some regions + # are unreachable. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Feature>] @@ -562,7 +674,7 @@ def get_membership request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload get_feature(name: nil) + # @overload get_feature(name: nil, return_partial_success: nil) # Pass arguments to `get_feature` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -570,6 +682,11 @@ def get_membership request, options = nil # @param name [::String] # Required. The Feature resource name in the format # `projects/*/locations/*/features/*` + # @param return_partial_success [::Boolean] + # Optional. If set to true, the response will return partial results when + # some regions are unreachable and the unreachable field in Feature proto + # will be populated. If set to false, the request will fail when some regions + # are unreachable. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::GkeHub::V1::Feature] @@ -786,7 +903,7 @@ def create_membership request, options = nil # @param resource [::Google::Cloud::GkeHub::V1::Feature, ::Hash] # The Feature resource to create. # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID + # A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes after the first request. @@ -1256,7 +1373,7 @@ def update_membership request, options = nil # If you specify the update_mask to be a special path "*", fully replaces all # user-modifiable fields to match `resource`. # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID + # A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes after the first request. @@ -1457,160 +1574,3253 @@ def generate_connect_manifest request, options = nil end ## - # Configuration class for the GkeHub API. - # - # This class represents the configuration for GkeHub, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::GkeHub::V1::GkeHub::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. + # Creates a fleet. # - # Configuration can be applied globally to all clients, or to a single client - # on construction. + # @overload create_fleet(request, options = nil) + # Pass arguments to `create_fleet` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateFleetRequest} or an equivalent Hash. # - # @example + # @param request [::Google::Cloud::GkeHub::V1::CreateFleetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # # Modify the global config, setting the timeout for - # # list_memberships to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::GkeHub::V1::GkeHub::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_memberships.timeout = 20.0 - # end + # @overload create_fleet(parent: nil, fleet: nil) + # Pass arguments to `create_fleet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_memberships.timeout = 20.0 - # end + # @param parent [::String] + # Required. The parent (project and location) where the Fleet will be + # created. Specified in the format `projects/*/locations/*`. + # @param fleet [::Google::Cloud::GkeHub::V1::Fleet, ::Hash] + # Required. The fleet to create. # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. + # @return [::Gapic::Operation] # - # @example + # @raise [::Google::Cloud::Error] if the RPC is aborted. # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. + # @example Basic example + # require "google/cloud/gke_hub/v1" # - # require "googleauth" + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateFleetRequest.new # - # client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| - # config.credentials = credentials - # end + # # Call the create_fleet method. + # result = client.create_fleet request # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end # - class Configuration - extend ::Gapic::Config + def create_fleet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "gkehub.googleapis.com" + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateFleetRequest - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? + # Customize the options with defaults + metadata = @config.rpcs.create_fleet.metadata.to_h - yield self if block_given? - end + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_fleet.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_fleet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :create_fleet, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a fleet. + # + # @overload get_fleet(request, options = nil) + # Pass arguments to `get_fleet` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetFleetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetFleetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_fleet(name: nil) + # Pass arguments to `get_fleet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Fleet resource name in the format + # `projects/*/locations/*/fleets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::GkeHub::V1::Fleet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::GkeHub::V1::Fleet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetFleetRequest.new + # + # # Call the get_fleet method. + # result = client.get_fleet request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::Fleet. + # p result + # + def get_fleet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetFleetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_fleet.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_fleet.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_fleet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :get_fleet, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a fleet. + # + # @overload update_fleet(request, options = nil) + # Pass arguments to `update_fleet` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateFleetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateFleetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_fleet(fleet: nil, update_mask: nil) + # Pass arguments to `update_fleet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param fleet [::Google::Cloud::GkeHub::V1::Fleet, ::Hash] + # Required. The Fleet to update. + # + # The `name` field of the Fleet object identifies which fleet will be + # updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated; + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateFleetRequest.new + # + # # Call the update_fleet method. + # result = client.update_fleet request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_fleet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateFleetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_fleet.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.fleet&.name + header_params["fleet.name"] = request.fleet.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_fleet.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_fleet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :update_fleet, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Removes a Fleet. There must be no memberships remaining in the Fleet. + # + # @overload delete_fleet(request, options = nil) + # Pass arguments to `delete_fleet` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteFleetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteFleetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_fleet(name: nil) + # Pass arguments to `delete_fleet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Fleet resource name in the format + # `projects/*/locations/*/fleets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteFleetRequest.new + # + # # Call the delete_fleet method. + # result = client.delete_fleet request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_fleet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteFleetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_fleet.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_fleet.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_fleet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :delete_fleet, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns all fleets within an organization or a project that the caller has + # access to. + # + # @overload list_fleets(request, options = nil) + # Pass arguments to `list_fleets` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListFleetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListFleetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_fleets(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_fleets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The organization or project to list for Fleets under, in the + # format `organizations/*/locations/*` or `projects/*/locations/*`. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListFleets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListFleets` must match + # the call that provided the page token. + # @param page_size [::Integer] + # Optional. The maximum number of fleets to return. The service may return + # fewer than this value. If unspecified, at most 200 fleets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Fleet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Fleet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListFleetsRequest.new + # + # # Call the list_fleets method. + # result = client.list_fleets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Fleet. + # p item + # end + # + def list_fleets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListFleetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_fleets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_fleets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_fleets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :list_fleets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_fleets, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a fleet namespace. + # + # @overload get_scope_namespace(request, options = nil) + # Pass arguments to `get_scope_namespace` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_scope_namespace(name: nil) + # Pass arguments to `get_scope_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Namespace resource name in the format + # `projects/*/locations/*/scopes/*/namespaces/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::GkeHub::V1::Namespace] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::GkeHub::V1::Namespace] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest.new + # + # # Call the get_scope_namespace method. + # result = client.get_scope_namespace request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::Namespace. + # p result + # + def get_scope_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_scope_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_scope_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_scope_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :get_scope_namespace, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a fleet namespace. + # + # @overload create_scope_namespace(request, options = nil) + # Pass arguments to `create_scope_namespace` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_scope_namespace(parent: nil, scope_namespace_id: nil, scope_namespace: nil) + # Pass arguments to `create_scope_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Namespace will be + # created. Specified in the format `projects/*/locations/*/scopes/*`. + # @param scope_namespace_id [::String] + # Required. Client chosen ID for the Namespace. `namespace_id` must be a + # valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @param scope_namespace [::Google::Cloud::GkeHub::V1::Namespace, ::Hash] + # Required. The fleet namespace to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest.new + # + # # Call the create_scope_namespace method. + # result = client.create_scope_namespace request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_scope_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_scope_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_scope_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_scope_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :create_scope_namespace, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a fleet namespace. + # + # @overload update_scope_namespace(request, options = nil) + # Pass arguments to `update_scope_namespace` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_scope_namespace(scope_namespace: nil, update_mask: nil) + # Pass arguments to `update_scope_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param scope_namespace [::Google::Cloud::GkeHub::V1::Namespace, ::Hash] + # Required. A namespace with fields updated. The 'name' field in this + # namespace is used to identify the resource to update. Given 'updated' + # prefix to follow go/proto-best-practices-checkers#keyword_conflict + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest.new + # + # # Call the update_scope_namespace method. + # result = client.update_scope_namespace request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_scope_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_scope_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.scope_namespace&.name + header_params["scope_namespace.name"] = request.scope_namespace.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_scope_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_scope_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :update_scope_namespace, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a fleet namespace. + # + # @overload delete_scope_namespace(request, options = nil) + # Pass arguments to `delete_scope_namespace` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_scope_namespace(name: nil) + # Pass arguments to `delete_scope_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Namespace resource name in the format + # `projects/*/locations/*/scopes/*/namespaces/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest.new + # + # # Call the delete_scope_namespace method. + # result = client.delete_scope_namespace request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_scope_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_scope_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_scope_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_scope_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :delete_scope_namespace, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists fleet namespaces. + # + # @overload list_scope_namespaces(request, options = nil) + # Pass arguments to `list_scope_namespaces` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_scope_namespaces(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_scope_namespaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/scopes/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListFeatures` which + # specifies the position in the list from where to continue listing the + # resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Namespace>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Namespace>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest.new + # + # # Call the list_scope_namespaces method. + # result = client.list_scope_namespaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Namespace. + # p item + # end + # + def list_scope_namespaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_scope_namespaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_scope_namespaces.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_scope_namespaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :list_scope_namespaces, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_scope_namespaces, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a Scope RBACRoleBinding. + # + # @overload get_scope_rbac_role_binding(request, options = nil) + # Pass arguments to `get_scope_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_scope_rbac_role_binding(name: nil) + # Pass arguments to `get_scope_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest.new + # + # # Call the get_scope_rbac_role_binding method. + # result = client.get_scope_rbac_role_binding request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::RBACRoleBinding. + # p result + # + def get_scope_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_scope_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_scope_rbac_role_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_scope_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :get_scope_rbac_role_binding, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Scope RBACRoleBinding. + # + # @overload create_scope_rbac_role_binding(request, options = nil) + # Pass arguments to `create_scope_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_scope_rbac_role_binding(parent: nil, rbacrolebinding_id: nil, rbacrolebinding: nil) + # Pass arguments to `create_scope_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/scopes/*`. + # @param rbacrolebinding_id [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. The rbacrolebindings to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest.new + # + # # Call the create_scope_rbac_role_binding method. + # result = client.create_scope_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_scope_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_scope_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_scope_rbac_role_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_scope_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :create_scope_rbac_role_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Scope RBACRoleBinding. + # + # @overload update_scope_rbac_role_binding(request, options = nil) + # Pass arguments to `update_scope_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_scope_rbac_role_binding(rbacrolebinding: nil, update_mask: nil) + # Pass arguments to `update_scope_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. A rbacrolebinding with fields updated. The 'name' field in this + # rbacrolebinding is used to identify the resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest.new + # + # # Call the update_scope_rbac_role_binding method. + # result = client.update_scope_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_scope_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_scope_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.rbacrolebinding&.name + header_params["rbacrolebinding.name"] = request.rbacrolebinding.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_scope_rbac_role_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_scope_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :update_scope_rbac_role_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Scope RBACRoleBinding. + # + # @overload delete_scope_rbac_role_binding(request, options = nil) + # Pass arguments to `delete_scope_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_scope_rbac_role_binding(name: nil) + # Pass arguments to `delete_scope_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest.new + # + # # Call the delete_scope_rbac_role_binding method. + # result = client.delete_scope_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_scope_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_scope_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_scope_rbac_role_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_scope_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :delete_scope_rbac_role_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Scope RBACRoleBindings. + # + # @overload list_scope_rbac_role_bindings(request, options = nil) + # Pass arguments to `list_scope_rbac_role_bindings` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_scope_rbac_role_bindings(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_scope_rbac_role_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/scopes/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListScopeRBACRoleBindings` + # which specifies the position in the list from where to continue listing the + # resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest.new + # + # # Call the list_scope_rbac_role_bindings method. + # result = client.list_scope_rbac_role_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::RBACRoleBinding. + # p item + # end + # + def list_scope_rbac_role_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_scope_rbac_role_bindings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_scope_rbac_role_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_scope_rbac_role_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :list_scope_rbac_role_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_scope_rbac_role_bindings, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a Scope. + # + # @overload get_scope(request, options = nil) + # Pass arguments to `get_scope` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetScopeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetScopeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_scope(name: nil) + # Pass arguments to `get_scope` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Scope resource name in the format + # `projects/*/locations/*/scopes/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::GkeHub::V1::Scope] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::GkeHub::V1::Scope] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetScopeRequest.new + # + # # Call the get_scope method. + # result = client.get_scope request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::Scope. + # p result + # + def get_scope request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetScopeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_scope.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_scope.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_scope.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :get_scope, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Scope. + # + # @overload create_scope(request, options = nil) + # Pass arguments to `create_scope` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateScopeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateScopeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_scope(parent: nil, scope_id: nil, scope: nil) + # Pass arguments to `create_scope` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Scope will be + # created. Specified in the format `projects/*/locations/*`. + # @param scope_id [::String] + # Required. Client chosen ID for the Scope. `scope_id` must be a + # ???? + # @param scope [::Google::Cloud::GkeHub::V1::Scope, ::Hash] + # Required. The Scope to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateScopeRequest.new + # + # # Call the create_scope method. + # result = client.create_scope request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_scope request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateScopeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_scope.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_scope.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_scope.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :create_scope, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a scopes. + # + # @overload update_scope(request, options = nil) + # Pass arguments to `update_scope` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateScopeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateScopeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_scope(scope: nil, update_mask: nil) + # Pass arguments to `update_scope` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param scope [::Google::Cloud::GkeHub::V1::Scope, ::Hash] + # Required. A Scope with fields updated. The 'name' field in this + # namespace is used to identify the resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateScopeRequest.new + # + # # Call the update_scope method. + # result = client.update_scope request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_scope request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateScopeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_scope.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.scope&.name + header_params["scope.name"] = request.scope.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_scope.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_scope.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :update_scope, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Scope. + # + # @overload delete_scope(request, options = nil) + # Pass arguments to `delete_scope` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteScopeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteScopeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_scope(name: nil) + # Pass arguments to `delete_scope` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Scope resource name in the format + # `projects/*/locations/*/scopes/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteScopeRequest.new + # + # # Call the delete_scope method. + # result = client.delete_scope request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_scope request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteScopeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_scope.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_scope.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_scope.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :delete_scope, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Scopes. + # + # @overload list_scopes(request, options = nil) + # Pass arguments to `list_scopes` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListScopesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListScopesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_scopes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_scopes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Scope will be listed. + # Specified in the format `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListScopes` which + # specifies the position in the list from where to continue listing the + # resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Scope>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Scope>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListScopesRequest.new + # + # # Call the list_scopes method. + # result = client.list_scopes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Scope. + # p item + # end + # + def list_scopes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListScopesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_scopes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_scopes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_scopes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :list_scopes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_scopes, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists permitted Scopes. + # + # @overload list_permitted_scopes(request, options = nil) + # Pass arguments to `list_permitted_scopes` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_permitted_scopes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_permitted_scopes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Scope will be listed. + # Specified in the format `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListPermittedScopes` which + # specifies the position in the list from where to continue listing the + # resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Scope>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Scope>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListPermittedScopesRequest.new + # + # # Call the list_permitted_scopes method. + # result = client.list_permitted_scopes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Scope. + # p item + # end + # + def list_permitted_scopes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_permitted_scopes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_permitted_scopes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_permitted_scopes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :list_permitted_scopes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_permitted_scopes, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a MembershipBinding. + # + # @overload get_membership_binding(request, options = nil) + # Pass arguments to `get_membership_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_membership_binding(name: nil) + # Pass arguments to `get_membership_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The MembershipBinding resource name in the format + # `projects/*/locations/*/memberships/*/bindings/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::GkeHub::V1::MembershipBinding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::GkeHub::V1::MembershipBinding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetMembershipBindingRequest.new + # + # # Call the get_membership_binding method. + # result = client.get_membership_binding request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::MembershipBinding. + # p result + # + def get_membership_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_membership_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_membership_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_membership_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :get_membership_binding, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a MembershipBinding. + # + # @overload create_membership_binding(request, options = nil) + # Pass arguments to `create_membership_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_membership_binding(parent: nil, membership_binding: nil, membership_binding_id: nil) + # Pass arguments to `create_membership_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the MembershipBinding + # will be created. Specified in the format + # `projects/*/locations/*/memberships/*`. + # @param membership_binding [::Google::Cloud::GkeHub::V1::MembershipBinding, ::Hash] + # Required. The MembershipBinding to create. + # @param membership_binding_id [::String] + # Required. The ID to use for the MembershipBinding. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest.new + # + # # Call the create_membership_binding method. + # result = client.create_membership_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_membership_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_membership_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_membership_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_membership_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :create_membership_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a MembershipBinding. + # + # @overload update_membership_binding(request, options = nil) + # Pass arguments to `update_membership_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_membership_binding(membership_binding: nil, update_mask: nil) + # Pass arguments to `update_membership_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param membership_binding [::Google::Cloud::GkeHub::V1::MembershipBinding, ::Hash] + # Required. The MembershipBinding object with fields updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest.new + # + # # Call the update_membership_binding method. + # result = client.update_membership_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_membership_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_membership_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.membership_binding&.name + header_params["membership_binding.name"] = request.membership_binding.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_membership_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_membership_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :update_membership_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a MembershipBinding. + # + # @overload delete_membership_binding(request, options = nil) + # Pass arguments to `delete_membership_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_membership_binding(name: nil) + # Pass arguments to `delete_membership_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The MembershipBinding resource name in the format + # `projects/*/locations/*/memberships/*/bindings/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest.new + # + # # Call the delete_membership_binding method. + # result = client.delete_membership_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_membership_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_membership_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_membership_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_membership_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :delete_membership_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists MembershipBindings. + # + # @overload list_membership_bindings(request, options = nil) + # Pass arguments to `list_membership_bindings` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_membership_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_membership_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent Membership for which the MembershipBindings will be + # listed. Specified in the format `projects/*/locations/*/memberships/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListMembershipBindings` which + # specifies the position in the list from where to continue listing the + # resources. + # @param filter [::String] + # Optional. Lists MembershipBindings that match the filter expression, + # following the syntax outlined in https://google.aip.dev/160. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::MembershipBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::MembershipBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest.new + # + # # Call the list_membership_bindings method. + # result = client.list_membership_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::MembershipBinding. + # p item + # end + # + def list_membership_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_membership_bindings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_membership_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_membership_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :list_membership_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_membership_bindings, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a Membership RBACRoleBinding. + # + # @overload get_membership_rbac_role_binding(request, options = nil) + # Pass arguments to `get_membership_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_membership_rbac_role_binding(name: nil) + # Pass arguments to `get_membership_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest.new + # + # # Call the get_membership_rbac_role_binding method. + # result = client.get_membership_rbac_role_binding request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::RBACRoleBinding. + # p result + # + def get_membership_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_membership_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_membership_rbac_role_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_membership_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :get_membership_rbac_role_binding, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Membership RBACRoleBinding. + # + # @overload create_membership_rbac_role_binding(request, options = nil) + # Pass arguments to `create_membership_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_membership_rbac_role_binding(parent: nil, rbacrolebinding_id: nil, rbacrolebinding: nil) + # Pass arguments to `create_membership_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/memberships/*`. + # @param rbacrolebinding_id [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. The rbacrolebindings to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest.new + # + # # Call the create_membership_rbac_role_binding method. + # result = client.create_membership_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_membership_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_membership_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_membership_rbac_role_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_membership_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :create_membership_rbac_role_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Membership RBACRoleBinding. + # + # @overload update_membership_rbac_role_binding(request, options = nil) + # Pass arguments to `update_membership_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_membership_rbac_role_binding(rbacrolebinding: nil, update_mask: nil) + # Pass arguments to `update_membership_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. A rbacrolebinding with fields updated. The 'name' field in this + # rbacrolebinding is used to identify the resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest.new + # + # # Call the update_membership_rbac_role_binding method. + # result = client.update_membership_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_membership_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_membership_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.rbacrolebinding&.name + header_params["rbacrolebinding.name"] = request.rbacrolebinding.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_membership_rbac_role_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_membership_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :update_membership_rbac_role_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Membership RBACRoleBinding. + # + # @overload delete_membership_rbac_role_binding(request, options = nil) + # Pass arguments to `delete_membership_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_membership_rbac_role_binding(name: nil) + # Pass arguments to `delete_membership_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest.new + # + # # Call the delete_membership_rbac_role_binding method. + # result = client.delete_membership_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_membership_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_membership_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_membership_rbac_role_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_membership_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :delete_membership_rbac_role_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Membership RBACRoleBindings. + # + # @overload list_membership_rbac_role_bindings(request, options = nil) + # Pass arguments to `list_membership_rbac_role_bindings` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_membership_rbac_role_bindings(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_membership_rbac_role_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/memberships/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to + # `ListMembershipRBACRoleBindings` which specifies the position in the list + # from where to continue listing the resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest.new + # + # # Call the list_membership_rbac_role_bindings method. + # result = client.list_membership_rbac_role_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::RBACRoleBinding. + # p item + # end + # + def list_membership_rbac_role_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_membership_rbac_role_bindings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_membership_rbac_role_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_membership_rbac_role_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :list_membership_rbac_role_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_membership_rbac_role_bindings, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generates a YAML of the RBAC policies for the specified + # RoleBinding and its associated impersonation resources. + # + # @overload generate_membership_rbac_role_binding_yaml(request, options = nil) + # Pass arguments to `generate_membership_rbac_role_binding_yaml` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_membership_rbac_role_binding_yaml(parent: nil, rbacrolebinding_id: nil, rbacrolebinding: nil) + # Pass arguments to `generate_membership_rbac_role_binding_yaml` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/memberships/*`. + # @param rbacrolebinding_id [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. The rbacrolebindings to generate the YAML for. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest.new + # + # # Call the generate_membership_rbac_role_binding_yaml method. + # result = client.generate_membership_rbac_role_binding_yaml request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse. + # p result + # + def generate_membership_rbac_role_binding_yaml request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_membership_rbac_role_binding_yaml.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_membership_rbac_role_binding_yaml.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_membership_rbac_role_binding_yaml.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.call_rpc :generate_membership_rbac_role_binding_yaml, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the GkeHub API. + # + # This class represents the configuration for GkeHub, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::GkeHub::V1::GkeHub::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_memberships to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::GkeHub::V1::GkeHub::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_memberships.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_memberships.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "gkehub.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end end ## @@ -1645,6 +4855,11 @@ class Rpcs # attr_reader :list_memberships ## + # RPC-specific configuration for `list_bound_memberships` + # @return [::Gapic::Config::Method] + # + attr_reader :list_bound_memberships + ## # RPC-specific configuration for `list_features` # @return [::Gapic::Config::Method] # @@ -1694,11 +4909,173 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :generate_connect_manifest + ## + # RPC-specific configuration for `create_fleet` + # @return [::Gapic::Config::Method] + # + attr_reader :create_fleet + ## + # RPC-specific configuration for `get_fleet` + # @return [::Gapic::Config::Method] + # + attr_reader :get_fleet + ## + # RPC-specific configuration for `update_fleet` + # @return [::Gapic::Config::Method] + # + attr_reader :update_fleet + ## + # RPC-specific configuration for `delete_fleet` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_fleet + ## + # RPC-specific configuration for `list_fleets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_fleets + ## + # RPC-specific configuration for `get_scope_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scope_namespace + ## + # RPC-specific configuration for `create_scope_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scope_namespace + ## + # RPC-specific configuration for `update_scope_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scope_namespace + ## + # RPC-specific configuration for `delete_scope_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scope_namespace + ## + # RPC-specific configuration for `list_scope_namespaces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scope_namespaces + ## + # RPC-specific configuration for `get_scope_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scope_rbac_role_binding + ## + # RPC-specific configuration for `create_scope_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scope_rbac_role_binding + ## + # RPC-specific configuration for `update_scope_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scope_rbac_role_binding + ## + # RPC-specific configuration for `delete_scope_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scope_rbac_role_binding + ## + # RPC-specific configuration for `list_scope_rbac_role_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scope_rbac_role_bindings + ## + # RPC-specific configuration for `get_scope` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scope + ## + # RPC-specific configuration for `create_scope` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scope + ## + # RPC-specific configuration for `update_scope` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scope + ## + # RPC-specific configuration for `delete_scope` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scope + ## + # RPC-specific configuration for `list_scopes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scopes + ## + # RPC-specific configuration for `list_permitted_scopes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_permitted_scopes + ## + # RPC-specific configuration for `get_membership_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_membership_binding + ## + # RPC-specific configuration for `create_membership_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_membership_binding + ## + # RPC-specific configuration for `update_membership_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_membership_binding + ## + # RPC-specific configuration for `delete_membership_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_membership_binding + ## + # RPC-specific configuration for `list_membership_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_membership_bindings + ## + # RPC-specific configuration for `get_membership_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_membership_rbac_role_binding + ## + # RPC-specific configuration for `create_membership_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_membership_rbac_role_binding + ## + # RPC-specific configuration for `update_membership_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_membership_rbac_role_binding + ## + # RPC-specific configuration for `delete_membership_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_membership_rbac_role_binding + ## + # RPC-specific configuration for `list_membership_rbac_role_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_membership_rbac_role_bindings + ## + # RPC-specific configuration for `generate_membership_rbac_role_binding_yaml` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_membership_rbac_role_binding_yaml # @private def initialize parent_rpcs = nil list_memberships_config = parent_rpcs.list_memberships if parent_rpcs.respond_to? :list_memberships @list_memberships = ::Gapic::Config::Method.new list_memberships_config + list_bound_memberships_config = parent_rpcs.list_bound_memberships if parent_rpcs.respond_to? :list_bound_memberships + @list_bound_memberships = ::Gapic::Config::Method.new list_bound_memberships_config list_features_config = parent_rpcs.list_features if parent_rpcs.respond_to? :list_features @list_features = ::Gapic::Config::Method.new list_features_config get_membership_config = parent_rpcs.get_membership if parent_rpcs.respond_to? :get_membership @@ -1719,6 +5096,70 @@ def initialize parent_rpcs = nil @update_feature = ::Gapic::Config::Method.new update_feature_config generate_connect_manifest_config = parent_rpcs.generate_connect_manifest if parent_rpcs.respond_to? :generate_connect_manifest @generate_connect_manifest = ::Gapic::Config::Method.new generate_connect_manifest_config + create_fleet_config = parent_rpcs.create_fleet if parent_rpcs.respond_to? :create_fleet + @create_fleet = ::Gapic::Config::Method.new create_fleet_config + get_fleet_config = parent_rpcs.get_fleet if parent_rpcs.respond_to? :get_fleet + @get_fleet = ::Gapic::Config::Method.new get_fleet_config + update_fleet_config = parent_rpcs.update_fleet if parent_rpcs.respond_to? :update_fleet + @update_fleet = ::Gapic::Config::Method.new update_fleet_config + delete_fleet_config = parent_rpcs.delete_fleet if parent_rpcs.respond_to? :delete_fleet + @delete_fleet = ::Gapic::Config::Method.new delete_fleet_config + list_fleets_config = parent_rpcs.list_fleets if parent_rpcs.respond_to? :list_fleets + @list_fleets = ::Gapic::Config::Method.new list_fleets_config + get_scope_namespace_config = parent_rpcs.get_scope_namespace if parent_rpcs.respond_to? :get_scope_namespace + @get_scope_namespace = ::Gapic::Config::Method.new get_scope_namespace_config + create_scope_namespace_config = parent_rpcs.create_scope_namespace if parent_rpcs.respond_to? :create_scope_namespace + @create_scope_namespace = ::Gapic::Config::Method.new create_scope_namespace_config + update_scope_namespace_config = parent_rpcs.update_scope_namespace if parent_rpcs.respond_to? :update_scope_namespace + @update_scope_namespace = ::Gapic::Config::Method.new update_scope_namespace_config + delete_scope_namespace_config = parent_rpcs.delete_scope_namespace if parent_rpcs.respond_to? :delete_scope_namespace + @delete_scope_namespace = ::Gapic::Config::Method.new delete_scope_namespace_config + list_scope_namespaces_config = parent_rpcs.list_scope_namespaces if parent_rpcs.respond_to? :list_scope_namespaces + @list_scope_namespaces = ::Gapic::Config::Method.new list_scope_namespaces_config + get_scope_rbac_role_binding_config = parent_rpcs.get_scope_rbac_role_binding if parent_rpcs.respond_to? :get_scope_rbac_role_binding + @get_scope_rbac_role_binding = ::Gapic::Config::Method.new get_scope_rbac_role_binding_config + create_scope_rbac_role_binding_config = parent_rpcs.create_scope_rbac_role_binding if parent_rpcs.respond_to? :create_scope_rbac_role_binding + @create_scope_rbac_role_binding = ::Gapic::Config::Method.new create_scope_rbac_role_binding_config + update_scope_rbac_role_binding_config = parent_rpcs.update_scope_rbac_role_binding if parent_rpcs.respond_to? :update_scope_rbac_role_binding + @update_scope_rbac_role_binding = ::Gapic::Config::Method.new update_scope_rbac_role_binding_config + delete_scope_rbac_role_binding_config = parent_rpcs.delete_scope_rbac_role_binding if parent_rpcs.respond_to? :delete_scope_rbac_role_binding + @delete_scope_rbac_role_binding = ::Gapic::Config::Method.new delete_scope_rbac_role_binding_config + list_scope_rbac_role_bindings_config = parent_rpcs.list_scope_rbac_role_bindings if parent_rpcs.respond_to? :list_scope_rbac_role_bindings + @list_scope_rbac_role_bindings = ::Gapic::Config::Method.new list_scope_rbac_role_bindings_config + get_scope_config = parent_rpcs.get_scope if parent_rpcs.respond_to? :get_scope + @get_scope = ::Gapic::Config::Method.new get_scope_config + create_scope_config = parent_rpcs.create_scope if parent_rpcs.respond_to? :create_scope + @create_scope = ::Gapic::Config::Method.new create_scope_config + update_scope_config = parent_rpcs.update_scope if parent_rpcs.respond_to? :update_scope + @update_scope = ::Gapic::Config::Method.new update_scope_config + delete_scope_config = parent_rpcs.delete_scope if parent_rpcs.respond_to? :delete_scope + @delete_scope = ::Gapic::Config::Method.new delete_scope_config + list_scopes_config = parent_rpcs.list_scopes if parent_rpcs.respond_to? :list_scopes + @list_scopes = ::Gapic::Config::Method.new list_scopes_config + list_permitted_scopes_config = parent_rpcs.list_permitted_scopes if parent_rpcs.respond_to? :list_permitted_scopes + @list_permitted_scopes = ::Gapic::Config::Method.new list_permitted_scopes_config + get_membership_binding_config = parent_rpcs.get_membership_binding if parent_rpcs.respond_to? :get_membership_binding + @get_membership_binding = ::Gapic::Config::Method.new get_membership_binding_config + create_membership_binding_config = parent_rpcs.create_membership_binding if parent_rpcs.respond_to? :create_membership_binding + @create_membership_binding = ::Gapic::Config::Method.new create_membership_binding_config + update_membership_binding_config = parent_rpcs.update_membership_binding if parent_rpcs.respond_to? :update_membership_binding + @update_membership_binding = ::Gapic::Config::Method.new update_membership_binding_config + delete_membership_binding_config = parent_rpcs.delete_membership_binding if parent_rpcs.respond_to? :delete_membership_binding + @delete_membership_binding = ::Gapic::Config::Method.new delete_membership_binding_config + list_membership_bindings_config = parent_rpcs.list_membership_bindings if parent_rpcs.respond_to? :list_membership_bindings + @list_membership_bindings = ::Gapic::Config::Method.new list_membership_bindings_config + get_membership_rbac_role_binding_config = parent_rpcs.get_membership_rbac_role_binding if parent_rpcs.respond_to? :get_membership_rbac_role_binding + @get_membership_rbac_role_binding = ::Gapic::Config::Method.new get_membership_rbac_role_binding_config + create_membership_rbac_role_binding_config = parent_rpcs.create_membership_rbac_role_binding if parent_rpcs.respond_to? :create_membership_rbac_role_binding + @create_membership_rbac_role_binding = ::Gapic::Config::Method.new create_membership_rbac_role_binding_config + update_membership_rbac_role_binding_config = parent_rpcs.update_membership_rbac_role_binding if parent_rpcs.respond_to? :update_membership_rbac_role_binding + @update_membership_rbac_role_binding = ::Gapic::Config::Method.new update_membership_rbac_role_binding_config + delete_membership_rbac_role_binding_config = parent_rpcs.delete_membership_rbac_role_binding if parent_rpcs.respond_to? :delete_membership_rbac_role_binding + @delete_membership_rbac_role_binding = ::Gapic::Config::Method.new delete_membership_rbac_role_binding_config + list_membership_rbac_role_bindings_config = parent_rpcs.list_membership_rbac_role_bindings if parent_rpcs.respond_to? :list_membership_rbac_role_bindings + @list_membership_rbac_role_bindings = ::Gapic::Config::Method.new list_membership_rbac_role_bindings_config + generate_membership_rbac_role_binding_yaml_config = parent_rpcs.generate_membership_rbac_role_binding_yaml if parent_rpcs.respond_to? :generate_membership_rbac_role_binding_yaml + @generate_membership_rbac_role_binding_yaml = ::Gapic::Config::Method.new generate_membership_rbac_role_binding_yaml_config yield self if block_given? end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/paths.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/paths.rb index d6c19dd3dd68..62b66b3b9f0b 100644 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/paths.rb +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/paths.rb @@ -43,6 +43,49 @@ def feature_path project:, location:, feature: "projects/#{project}/locations/#{location}/features/#{feature}" end + ## + # Create a fully-qualified Fleet resource string. + # + # @overload fleet_path(project:, location:, fleet:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/fleets/{fleet}` + # + # @param project [String] + # @param location [String] + # @param fleet [String] + # + # @overload fleet_path(organization:, location:, fleet:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/fleets/{fleet}` + # + # @param organization [String] + # @param location [String] + # @param fleet [String] + # + # @return [::String] + def fleet_path **args + resources = { + "fleet:location:project" => (proc do |project:, location:, fleet:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/fleets/#{fleet}" + end), + "fleet:location:organization" => (proc do |organization:, location:, fleet:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/fleets/#{fleet}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + ## # Create a fully-qualified Location resource string. # @@ -79,6 +122,114 @@ def membership_path project:, location:, membership: "projects/#{project}/locations/#{location}/memberships/#{membership}" end + ## + # Create a fully-qualified MembershipBinding resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}` + # + # @param project [String] + # @param location [String] + # @param membership [String] + # @param membershipbinding [String] + # + # @return [::String] + def membership_binding_path project:, location:, membership:, membershipbinding: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "membership cannot contain /" if membership.to_s.include? "/" + + "projects/#{project}/locations/#{location}/memberships/#{membership}/bindings/#{membershipbinding}" + end + + ## + # Create a fully-qualified Namespace resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/scopes/{scope}/namespaces/{namespace}` + # + # @param project [String] + # @param location [String] + # @param scope [String] + # @param namespace [String] + # + # @return [::String] + def namespace_path project:, location:, scope:, namespace: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "scope cannot contain /" if scope.to_s.include? "/" + + "projects/#{project}/locations/#{location}/scopes/#{scope}/namespaces/#{namespace}" + end + + ## + # Create a fully-qualified RBACRoleBinding resource string. + # + # @overload rbac_role_binding_path(project:, location:, scope:, rbacrolebinding:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}` + # + # @param project [String] + # @param location [String] + # @param scope [String] + # @param rbacrolebinding [String] + # + # @overload rbac_role_binding_path(project:, location:, membership:, rbacrolebinding:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding}` + # + # @param project [String] + # @param location [String] + # @param membership [String] + # @param rbacrolebinding [String] + # + # @return [::String] + def rbac_role_binding_path **args + resources = { + "location:project:rbacrolebinding:scope" => (proc do |project:, location:, scope:, rbacrolebinding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "scope cannot contain /" if scope.to_s.include? "/" + + "projects/#{project}/locations/#{location}/scopes/#{scope}/rbacrolebindings/#{rbacrolebinding}" + end), + "location:membership:project:rbacrolebinding" => (proc do |project:, location:, membership:, rbacrolebinding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "membership cannot contain /" if membership.to_s.include? "/" + + "projects/#{project}/locations/#{location}/memberships/#{membership}/rbacrolebindings/#{rbacrolebinding}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Scope resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/scopes/{scope}` + # + # @param project [String] + # @param location [String] + # @param scope [String] + # + # @return [::String] + def scope_path project:, location:, scope: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/scopes/#{scope}" + end + extend self end end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/client.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/client.rb index d9932b083356..17cfd971634f 100644 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/client.rb +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/client.rb @@ -329,6 +329,106 @@ def list_memberships request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Lists Memberships bound to a Scope. The response includes relevant + # Memberships from all regions. + # + # @overload list_bound_memberships(request, options = nil) + # Pass arguments to `list_bound_memberships` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_bound_memberships(scope_name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_bound_memberships` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param scope_name [::String] + # Required. Name of the Scope, in the format + # `projects/*/locations/global/scopes/*`, to which the Memberships are bound. + # @param filter [::String] + # Optional. Lists Memberships that match the filter expression, following the + # syntax outlined in https://google.aip.dev/160. Currently, filtering + # can be done only based on Memberships's `name`, `labels`, `create_time`, + # `update_time`, and `unique_id`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. Pagination is currently not supported; therefore, setting + # this field does not have any impact for now. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListBoundMemberships` which + # specifies the position in the list from where to continue listing the + # resources. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Membership>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Membership>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest.new + # + # # Call the list_bound_memberships method. + # result = client.list_bound_memberships request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Membership. + # p item + # end + # + def list_bound_memberships request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_bound_memberships.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_bound_memberships.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_bound_memberships.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.list_bound_memberships request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gke_hub_stub, :list_bound_memberships, "memberships", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Lists Features in a given project and location. # @@ -342,7 +442,7 @@ def list_memberships request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload list_features(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # @overload list_features(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, return_partial_success: nil) # Pass arguments to `list_features` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -378,6 +478,11 @@ def list_memberships request, options = nil # @param order_by [::String] # One or more fields to compare and use to sort the output. # See https://google.aip.dev/132#ordering. + # @param return_partial_success [::Boolean] + # Optional. If set to true, the response will return partial results when + # some regions are unreachable and the unreachable field in Feature proto + # will be populated. If set to false, the request will fail when some regions + # are unreachable. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Feature>] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -534,7 +639,7 @@ def get_membership request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload get_feature(name: nil) + # @overload get_feature(name: nil, return_partial_success: nil) # Pass arguments to `get_feature` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -542,6 +647,11 @@ def get_membership request, options = nil # @param name [::String] # Required. The Feature resource name in the format # `projects/*/locations/*/features/*` + # @param return_partial_success [::Boolean] + # Optional. If set to true, the response will return partial results when + # some regions are unreachable and the unreachable field in Feature proto + # will be populated. If set to false, the request will fail when some regions + # are unreachable. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeHub::V1::Feature] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -744,7 +854,7 @@ def create_membership request, options = nil # @param resource [::Google::Cloud::GkeHub::V1::Feature, ::Hash] # The Feature resource to create. # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID + # A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes after the first request. @@ -1186,7 +1296,7 @@ def update_membership request, options = nil # If you specify the update_mask to be a special path "*", fully replaces all # user-modifiable fields to match `resource`. # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID + # A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes after the first request. @@ -1373,147 +1483,3016 @@ def generate_connect_manifest request, options = nil end ## - # Configuration class for the GkeHub REST API. + # Creates a fleet. # - # This class represents the configuration for GkeHub REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. + # @overload create_fleet(request, options = nil) + # Pass arguments to `create_fleet` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateFleetRequest} or an equivalent Hash. # - # Configuration can be applied globally to all clients, or to a single client - # on construction. + # @param request [::Google::Cloud::GkeHub::V1::CreateFleetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @example + # @overload create_fleet(parent: nil, fleet: nil) + # Pass arguments to `create_fleet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). # - # # Modify the global config, setting the timeout for - # # list_memberships to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_memberships.timeout = 20.0 - # end + # @param parent [::String] + # Required. The parent (project and location) where the Fleet will be + # created. Specified in the format `projects/*/locations/*`. + # @param fleet [::Google::Cloud::GkeHub::V1::Fleet, ::Hash] + # Required. The fleet to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_memberships.timeout = 20.0 - # end + # @return [::Gapic::Operation] # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials + # @raise [::Google::Cloud::Error] if the REST call is aborted. # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] + # @example Basic example + # require "google/cloud/gke_hub/v1" # - class Configuration - extend ::Gapic::Config + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateFleetRequest.new + # + # # Call the create_fleet method. + # result = client.create_fleet request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_fleet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "gkehub.googleapis.com" + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateFleetRequest - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? + # Customize the options with defaults + call_metadata = @config.rpcs.create_fleet.metadata.to_h - yield self if block_given? - end + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_fleet.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_fleet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.create_fleet request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end - ## - # Configuration RPC class for the GkeHub API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + ## + # Returns the details of a fleet. + # + # @overload get_fleet(request, options = nil) + # Pass arguments to `get_fleet` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetFleetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetFleetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_fleet(name: nil) + # Pass arguments to `get_fleet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Fleet resource name in the format + # `projects/*/locations/*/fleets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::Fleet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::Fleet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetFleetRequest.new + # + # # Call the get_fleet method. + # result = client.get_fleet request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::Fleet. + # p result + # + def get_fleet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetFleetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_fleet.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_fleet.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_fleet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.get_fleet request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a fleet. + # + # @overload update_fleet(request, options = nil) + # Pass arguments to `update_fleet` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateFleetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateFleetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_fleet(fleet: nil, update_mask: nil) + # Pass arguments to `update_fleet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param fleet [::Google::Cloud::GkeHub::V1::Fleet, ::Hash] + # Required. The Fleet to update. + # + # The `name` field of the Fleet object identifies which fleet will be + # updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated; + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateFleetRequest.new + # + # # Call the update_fleet method. + # result = client.update_fleet request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_fleet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateFleetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_fleet.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_fleet.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_fleet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.update_fleet request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Removes a Fleet. There must be no memberships remaining in the Fleet. + # + # @overload delete_fleet(request, options = nil) + # Pass arguments to `delete_fleet` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteFleetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteFleetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_fleet(name: nil) + # Pass arguments to `delete_fleet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Fleet resource name in the format + # `projects/*/locations/*/fleets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteFleetRequest.new + # + # # Call the delete_fleet method. + # result = client.delete_fleet request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_fleet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteFleetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_fleet.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_fleet.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_fleet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.delete_fleet request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns all fleets within an organization or a project that the caller has + # access to. + # + # @overload list_fleets(request, options = nil) + # Pass arguments to `list_fleets` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListFleetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListFleetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_fleets(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_fleets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The organization or project to list for Fleets under, in the + # format `organizations/*/locations/*` or `projects/*/locations/*`. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListFleets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListFleets` must match + # the call that provided the page token. + # @param page_size [::Integer] + # Optional. The maximum number of fleets to return. The service may return + # fewer than this value. If unspecified, at most 200 fleets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Fleet>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Fleet>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListFleetsRequest.new + # + # # Call the list_fleets method. + # result = client.list_fleets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Fleet. + # p item + # end + # + def list_fleets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListFleetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_fleets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_fleets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_fleets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.list_fleets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gke_hub_stub, :list_fleets, "fleets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a fleet namespace. + # + # @overload get_scope_namespace(request, options = nil) + # Pass arguments to `get_scope_namespace` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_scope_namespace(name: nil) + # Pass arguments to `get_scope_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Namespace resource name in the format + # `projects/*/locations/*/scopes/*/namespaces/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::Namespace] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest.new + # + # # Call the get_scope_namespace method. + # result = client.get_scope_namespace request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::Namespace. + # p result + # + def get_scope_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_scope_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_scope_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_scope_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.get_scope_namespace request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a fleet namespace. + # + # @overload create_scope_namespace(request, options = nil) + # Pass arguments to `create_scope_namespace` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_scope_namespace(parent: nil, scope_namespace_id: nil, scope_namespace: nil) + # Pass arguments to `create_scope_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Namespace will be + # created. Specified in the format `projects/*/locations/*/scopes/*`. + # @param scope_namespace_id [::String] + # Required. Client chosen ID for the Namespace. `namespace_id` must be a + # valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @param scope_namespace [::Google::Cloud::GkeHub::V1::Namespace, ::Hash] + # Required. The fleet namespace to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest.new + # + # # Call the create_scope_namespace method. + # result = client.create_scope_namespace request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_scope_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_scope_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_scope_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_scope_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.create_scope_namespace request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a fleet namespace. + # + # @overload update_scope_namespace(request, options = nil) + # Pass arguments to `update_scope_namespace` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_scope_namespace(scope_namespace: nil, update_mask: nil) + # Pass arguments to `update_scope_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param scope_namespace [::Google::Cloud::GkeHub::V1::Namespace, ::Hash] + # Required. A namespace with fields updated. The 'name' field in this + # namespace is used to identify the resource to update. Given 'updated' + # prefix to follow go/proto-best-practices-checkers#keyword_conflict + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest.new + # + # # Call the update_scope_namespace method. + # result = client.update_scope_namespace request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_scope_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_scope_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_scope_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_scope_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.update_scope_namespace request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a fleet namespace. + # + # @overload delete_scope_namespace(request, options = nil) + # Pass arguments to `delete_scope_namespace` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_scope_namespace(name: nil) + # Pass arguments to `delete_scope_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Namespace resource name in the format + # `projects/*/locations/*/scopes/*/namespaces/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest.new + # + # # Call the delete_scope_namespace method. + # result = client.delete_scope_namespace request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_scope_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_scope_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_scope_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_scope_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.delete_scope_namespace request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists fleet namespaces. + # + # @overload list_scope_namespaces(request, options = nil) + # Pass arguments to `list_scope_namespaces` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_scope_namespaces(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_scope_namespaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/scopes/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListFeatures` which + # specifies the position in the list from where to continue listing the + # resources. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Namespace>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Namespace>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest.new + # + # # Call the list_scope_namespaces method. + # result = client.list_scope_namespaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Namespace. + # p item + # end + # + def list_scope_namespaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_scope_namespaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_scope_namespaces.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_scope_namespaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.list_scope_namespaces request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gke_hub_stub, :list_scope_namespaces, "scope_namespaces", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a Scope RBACRoleBinding. + # + # @overload get_scope_rbac_role_binding(request, options = nil) + # Pass arguments to `get_scope_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_scope_rbac_role_binding(name: nil) + # Pass arguments to `get_scope_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest.new + # + # # Call the get_scope_rbac_role_binding method. + # result = client.get_scope_rbac_role_binding request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::RBACRoleBinding. + # p result + # + def get_scope_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_scope_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_scope_rbac_role_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_scope_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.get_scope_rbac_role_binding request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Scope RBACRoleBinding. + # + # @overload create_scope_rbac_role_binding(request, options = nil) + # Pass arguments to `create_scope_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_scope_rbac_role_binding(parent: nil, rbacrolebinding_id: nil, rbacrolebinding: nil) + # Pass arguments to `create_scope_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/scopes/*`. + # @param rbacrolebinding_id [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. The rbacrolebindings to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest.new + # + # # Call the create_scope_rbac_role_binding method. + # result = client.create_scope_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_scope_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_scope_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_scope_rbac_role_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_scope_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.create_scope_rbac_role_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Scope RBACRoleBinding. + # + # @overload update_scope_rbac_role_binding(request, options = nil) + # Pass arguments to `update_scope_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_scope_rbac_role_binding(rbacrolebinding: nil, update_mask: nil) + # Pass arguments to `update_scope_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. A rbacrolebinding with fields updated. The 'name' field in this + # rbacrolebinding is used to identify the resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest.new + # + # # Call the update_scope_rbac_role_binding method. + # result = client.update_scope_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_scope_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_scope_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_scope_rbac_role_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_scope_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.update_scope_rbac_role_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Scope RBACRoleBinding. + # + # @overload delete_scope_rbac_role_binding(request, options = nil) + # Pass arguments to `delete_scope_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_scope_rbac_role_binding(name: nil) + # Pass arguments to `delete_scope_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest.new + # + # # Call the delete_scope_rbac_role_binding method. + # result = client.delete_scope_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_scope_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_scope_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_scope_rbac_role_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_scope_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.delete_scope_rbac_role_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Scope RBACRoleBindings. + # + # @overload list_scope_rbac_role_bindings(request, options = nil) + # Pass arguments to `list_scope_rbac_role_bindings` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_scope_rbac_role_bindings(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_scope_rbac_role_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/scopes/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListScopeRBACRoleBindings` + # which specifies the position in the list from where to continue listing the + # resources. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest.new + # + # # Call the list_scope_rbac_role_bindings method. + # result = client.list_scope_rbac_role_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::RBACRoleBinding. + # p item + # end + # + def list_scope_rbac_role_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_scope_rbac_role_bindings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_scope_rbac_role_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_scope_rbac_role_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.list_scope_rbac_role_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gke_hub_stub, :list_scope_rbac_role_bindings, "rbacrolebindings", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a Scope. + # + # @overload get_scope(request, options = nil) + # Pass arguments to `get_scope` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetScopeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetScopeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_scope(name: nil) + # Pass arguments to `get_scope` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Scope resource name in the format + # `projects/*/locations/*/scopes/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::Scope] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::Scope] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetScopeRequest.new + # + # # Call the get_scope method. + # result = client.get_scope request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::Scope. + # p result + # + def get_scope request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetScopeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_scope.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_scope.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_scope.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.get_scope request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Scope. + # + # @overload create_scope(request, options = nil) + # Pass arguments to `create_scope` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateScopeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateScopeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_scope(parent: nil, scope_id: nil, scope: nil) + # Pass arguments to `create_scope` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Scope will be + # created. Specified in the format `projects/*/locations/*`. + # @param scope_id [::String] + # Required. Client chosen ID for the Scope. `scope_id` must be a + # ???? + # @param scope [::Google::Cloud::GkeHub::V1::Scope, ::Hash] + # Required. The Scope to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateScopeRequest.new + # + # # Call the create_scope method. + # result = client.create_scope request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_scope request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateScopeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_scope.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_scope.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_scope.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.create_scope request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a scopes. + # + # @overload update_scope(request, options = nil) + # Pass arguments to `update_scope` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateScopeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateScopeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_scope(scope: nil, update_mask: nil) + # Pass arguments to `update_scope` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param scope [::Google::Cloud::GkeHub::V1::Scope, ::Hash] + # Required. A Scope with fields updated. The 'name' field in this + # namespace is used to identify the resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateScopeRequest.new + # + # # Call the update_scope method. + # result = client.update_scope request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_scope request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateScopeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_scope.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_scope.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_scope.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.update_scope request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Scope. + # + # @overload delete_scope(request, options = nil) + # Pass arguments to `delete_scope` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteScopeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteScopeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_scope(name: nil) + # Pass arguments to `delete_scope` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The Scope resource name in the format + # `projects/*/locations/*/scopes/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteScopeRequest.new + # + # # Call the delete_scope method. + # result = client.delete_scope request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_scope request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteScopeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_scope.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_scope.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_scope.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.delete_scope request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Scopes. + # + # @overload list_scopes(request, options = nil) + # Pass arguments to `list_scopes` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListScopesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListScopesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_scopes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_scopes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Scope will be listed. + # Specified in the format `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListScopes` which + # specifies the position in the list from where to continue listing the + # resources. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Scope>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Scope>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListScopesRequest.new + # + # # Call the list_scopes method. + # result = client.list_scopes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Scope. + # p item + # end + # + def list_scopes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListScopesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_scopes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_scopes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_scopes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.list_scopes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gke_hub_stub, :list_scopes, "scopes", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists permitted Scopes. + # + # @overload list_permitted_scopes(request, options = nil) + # Pass arguments to `list_permitted_scopes` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_permitted_scopes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_permitted_scopes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Scope will be listed. + # Specified in the format `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListPermittedScopes` which + # specifies the position in the list from where to continue listing the + # resources. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Scope>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::Scope>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListPermittedScopesRequest.new + # + # # Call the list_permitted_scopes method. + # result = client.list_permitted_scopes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::Scope. + # p item + # end + # + def list_permitted_scopes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_permitted_scopes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_permitted_scopes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_permitted_scopes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.list_permitted_scopes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gke_hub_stub, :list_permitted_scopes, "scopes", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a MembershipBinding. + # + # @overload get_membership_binding(request, options = nil) + # Pass arguments to `get_membership_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_membership_binding(name: nil) + # Pass arguments to `get_membership_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The MembershipBinding resource name in the format + # `projects/*/locations/*/memberships/*/bindings/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::MembershipBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::MembershipBinding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetMembershipBindingRequest.new + # + # # Call the get_membership_binding method. + # result = client.get_membership_binding request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::MembershipBinding. + # p result + # + def get_membership_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_membership_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_membership_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_membership_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.get_membership_binding request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a MembershipBinding. + # + # @overload create_membership_binding(request, options = nil) + # Pass arguments to `create_membership_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_membership_binding(parent: nil, membership_binding: nil, membership_binding_id: nil) + # Pass arguments to `create_membership_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the MembershipBinding + # will be created. Specified in the format + # `projects/*/locations/*/memberships/*`. + # @param membership_binding [::Google::Cloud::GkeHub::V1::MembershipBinding, ::Hash] + # Required. The MembershipBinding to create. + # @param membership_binding_id [::String] + # Required. The ID to use for the MembershipBinding. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest.new + # + # # Call the create_membership_binding method. + # result = client.create_membership_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_membership_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_membership_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_membership_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_membership_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.create_membership_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a MembershipBinding. + # + # @overload update_membership_binding(request, options = nil) + # Pass arguments to `update_membership_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_membership_binding(membership_binding: nil, update_mask: nil) + # Pass arguments to `update_membership_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param membership_binding [::Google::Cloud::GkeHub::V1::MembershipBinding, ::Hash] + # Required. The MembershipBinding object with fields updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest.new + # + # # Call the update_membership_binding method. + # result = client.update_membership_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_membership_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_membership_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_membership_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_membership_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.update_membership_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a MembershipBinding. + # + # @overload delete_membership_binding(request, options = nil) + # Pass arguments to `delete_membership_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_membership_binding(name: nil) + # Pass arguments to `delete_membership_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The MembershipBinding resource name in the format + # `projects/*/locations/*/memberships/*/bindings/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest.new + # + # # Call the delete_membership_binding method. + # result = client.delete_membership_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_membership_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_membership_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_membership_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_membership_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.delete_membership_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists MembershipBindings. + # + # @overload list_membership_bindings(request, options = nil) + # Pass arguments to `list_membership_bindings` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_membership_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_membership_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent Membership for which the MembershipBindings will be + # listed. Specified in the format `projects/*/locations/*/memberships/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to `ListMembershipBindings` which + # specifies the position in the list from where to continue listing the + # resources. + # @param filter [::String] + # Optional. Lists MembershipBindings that match the filter expression, + # following the syntax outlined in https://google.aip.dev/160. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::MembershipBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::MembershipBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest.new + # + # # Call the list_membership_bindings method. + # result = client.list_membership_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::MembershipBinding. + # p item + # end + # + def list_membership_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_membership_bindings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_membership_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_membership_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.list_membership_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gke_hub_stub, :list_membership_bindings, "membership_bindings", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the details of a Membership RBACRoleBinding. + # + # @overload get_membership_rbac_role_binding(request, options = nil) + # Pass arguments to `get_membership_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_membership_rbac_role_binding(name: nil) + # Pass arguments to `get_membership_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest.new + # + # # Call the get_membership_rbac_role_binding method. + # result = client.get_membership_rbac_role_binding request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::RBACRoleBinding. + # p result + # + def get_membership_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_membership_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_membership_rbac_role_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_membership_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.get_membership_rbac_role_binding request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Membership RBACRoleBinding. + # + # @overload create_membership_rbac_role_binding(request, options = nil) + # Pass arguments to `create_membership_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_membership_rbac_role_binding(parent: nil, rbacrolebinding_id: nil, rbacrolebinding: nil) + # Pass arguments to `create_membership_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/memberships/*`. + # @param rbacrolebinding_id [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. The rbacrolebindings to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest.new + # + # # Call the create_membership_rbac_role_binding method. + # result = client.create_membership_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_membership_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_membership_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_membership_rbac_role_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_membership_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.create_membership_rbac_role_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Membership RBACRoleBinding. + # + # @overload update_membership_rbac_role_binding(request, options = nil) + # Pass arguments to `update_membership_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_membership_rbac_role_binding(rbacrolebinding: nil, update_mask: nil) + # Pass arguments to `update_membership_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. A rbacrolebinding with fields updated. The 'name' field in this + # rbacrolebinding is used to identify the resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest.new + # + # # Call the update_membership_rbac_role_binding method. + # result = client.update_membership_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_membership_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_membership_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_membership_rbac_role_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_membership_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.update_membership_rbac_role_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Membership RBACRoleBinding. + # + # @overload delete_membership_rbac_role_binding(request, options = nil) + # Pass arguments to `delete_membership_rbac_role_binding` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_membership_rbac_role_binding(name: nil) + # Pass arguments to `delete_membership_rbac_role_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest.new + # + # # Call the delete_membership_rbac_role_binding method. + # result = client.delete_membership_rbac_role_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_membership_rbac_role_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_membership_rbac_role_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_membership_rbac_role_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_membership_rbac_role_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.delete_membership_rbac_role_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Membership RBACRoleBindings. + # + # @overload list_membership_rbac_role_bindings(request, options = nil) + # Pass arguments to `list_membership_rbac_role_bindings` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_membership_rbac_role_bindings(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_membership_rbac_role_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/memberships/*`. + # @param page_size [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @param page_token [::String] + # Optional. Token returned by previous call to + # `ListMembershipRBACRoleBindings` which specifies the position in the list + # from where to continue listing the resources. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest.new + # + # # Call the list_membership_rbac_role_bindings method. + # result = client.list_membership_rbac_role_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::GkeHub::V1::RBACRoleBinding. + # p item + # end + # + def list_membership_rbac_role_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_membership_rbac_role_bindings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_membership_rbac_role_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_membership_rbac_role_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.list_membership_rbac_role_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gke_hub_stub, :list_membership_rbac_role_bindings, "rbacrolebindings", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generates a YAML of the RBAC policies for the specified + # RoleBinding and its associated impersonation resources. + # + # @overload generate_membership_rbac_role_binding_yaml(request, options = nil) + # Pass arguments to `generate_membership_rbac_role_binding_yaml` via a request object, either of type + # {::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload generate_membership_rbac_role_binding_yaml(parent: nil, rbacrolebinding_id: nil, rbacrolebinding: nil) + # Pass arguments to `generate_membership_rbac_role_binding_yaml` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/memberships/*`. + # @param rbacrolebinding_id [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @param rbacrolebinding [::Google::Cloud::GkeHub::V1::RBACRoleBinding, ::Hash] + # Required. The rbacrolebindings to generate the YAML for. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/gke_hub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest.new + # + # # Call the generate_membership_rbac_role_binding_yaml method. + # result = client.generate_membership_rbac_role_binding_yaml request + # + # # The returned object is of type Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse. + # p result + # + def generate_membership_rbac_role_binding_yaml request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.generate_membership_rbac_role_binding_yaml.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::GkeHub::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.generate_membership_rbac_role_binding_yaml.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_membership_rbac_role_binding_yaml.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gke_hub_stub.generate_membership_rbac_role_binding_yaml request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the GkeHub REST API. + # + # This class represents the configuration for GkeHub REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_memberships to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_memberships.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_memberships.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "gkehub.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the GkeHub API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @@ -1524,6 +4503,11 @@ class Rpcs # attr_reader :list_memberships ## + # RPC-specific configuration for `list_bound_memberships` + # @return [::Gapic::Config::Method] + # + attr_reader :list_bound_memberships + ## # RPC-specific configuration for `list_features` # @return [::Gapic::Config::Method] # @@ -1573,11 +4557,173 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :generate_connect_manifest + ## + # RPC-specific configuration for `create_fleet` + # @return [::Gapic::Config::Method] + # + attr_reader :create_fleet + ## + # RPC-specific configuration for `get_fleet` + # @return [::Gapic::Config::Method] + # + attr_reader :get_fleet + ## + # RPC-specific configuration for `update_fleet` + # @return [::Gapic::Config::Method] + # + attr_reader :update_fleet + ## + # RPC-specific configuration for `delete_fleet` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_fleet + ## + # RPC-specific configuration for `list_fleets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_fleets + ## + # RPC-specific configuration for `get_scope_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scope_namespace + ## + # RPC-specific configuration for `create_scope_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scope_namespace + ## + # RPC-specific configuration for `update_scope_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scope_namespace + ## + # RPC-specific configuration for `delete_scope_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scope_namespace + ## + # RPC-specific configuration for `list_scope_namespaces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scope_namespaces + ## + # RPC-specific configuration for `get_scope_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scope_rbac_role_binding + ## + # RPC-specific configuration for `create_scope_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scope_rbac_role_binding + ## + # RPC-specific configuration for `update_scope_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scope_rbac_role_binding + ## + # RPC-specific configuration for `delete_scope_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scope_rbac_role_binding + ## + # RPC-specific configuration for `list_scope_rbac_role_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scope_rbac_role_bindings + ## + # RPC-specific configuration for `get_scope` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scope + ## + # RPC-specific configuration for `create_scope` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scope + ## + # RPC-specific configuration for `update_scope` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scope + ## + # RPC-specific configuration for `delete_scope` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scope + ## + # RPC-specific configuration for `list_scopes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scopes + ## + # RPC-specific configuration for `list_permitted_scopes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_permitted_scopes + ## + # RPC-specific configuration for `get_membership_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_membership_binding + ## + # RPC-specific configuration for `create_membership_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_membership_binding + ## + # RPC-specific configuration for `update_membership_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_membership_binding + ## + # RPC-specific configuration for `delete_membership_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_membership_binding + ## + # RPC-specific configuration for `list_membership_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_membership_bindings + ## + # RPC-specific configuration for `get_membership_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_membership_rbac_role_binding + ## + # RPC-specific configuration for `create_membership_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_membership_rbac_role_binding + ## + # RPC-specific configuration for `update_membership_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_membership_rbac_role_binding + ## + # RPC-specific configuration for `delete_membership_rbac_role_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_membership_rbac_role_binding + ## + # RPC-specific configuration for `list_membership_rbac_role_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_membership_rbac_role_bindings + ## + # RPC-specific configuration for `generate_membership_rbac_role_binding_yaml` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_membership_rbac_role_binding_yaml # @private def initialize parent_rpcs = nil list_memberships_config = parent_rpcs.list_memberships if parent_rpcs.respond_to? :list_memberships @list_memberships = ::Gapic::Config::Method.new list_memberships_config + list_bound_memberships_config = parent_rpcs.list_bound_memberships if parent_rpcs.respond_to? :list_bound_memberships + @list_bound_memberships = ::Gapic::Config::Method.new list_bound_memberships_config list_features_config = parent_rpcs.list_features if parent_rpcs.respond_to? :list_features @list_features = ::Gapic::Config::Method.new list_features_config get_membership_config = parent_rpcs.get_membership if parent_rpcs.respond_to? :get_membership @@ -1598,6 +4744,70 @@ def initialize parent_rpcs = nil @update_feature = ::Gapic::Config::Method.new update_feature_config generate_connect_manifest_config = parent_rpcs.generate_connect_manifest if parent_rpcs.respond_to? :generate_connect_manifest @generate_connect_manifest = ::Gapic::Config::Method.new generate_connect_manifest_config + create_fleet_config = parent_rpcs.create_fleet if parent_rpcs.respond_to? :create_fleet + @create_fleet = ::Gapic::Config::Method.new create_fleet_config + get_fleet_config = parent_rpcs.get_fleet if parent_rpcs.respond_to? :get_fleet + @get_fleet = ::Gapic::Config::Method.new get_fleet_config + update_fleet_config = parent_rpcs.update_fleet if parent_rpcs.respond_to? :update_fleet + @update_fleet = ::Gapic::Config::Method.new update_fleet_config + delete_fleet_config = parent_rpcs.delete_fleet if parent_rpcs.respond_to? :delete_fleet + @delete_fleet = ::Gapic::Config::Method.new delete_fleet_config + list_fleets_config = parent_rpcs.list_fleets if parent_rpcs.respond_to? :list_fleets + @list_fleets = ::Gapic::Config::Method.new list_fleets_config + get_scope_namespace_config = parent_rpcs.get_scope_namespace if parent_rpcs.respond_to? :get_scope_namespace + @get_scope_namespace = ::Gapic::Config::Method.new get_scope_namespace_config + create_scope_namespace_config = parent_rpcs.create_scope_namespace if parent_rpcs.respond_to? :create_scope_namespace + @create_scope_namespace = ::Gapic::Config::Method.new create_scope_namespace_config + update_scope_namespace_config = parent_rpcs.update_scope_namespace if parent_rpcs.respond_to? :update_scope_namespace + @update_scope_namespace = ::Gapic::Config::Method.new update_scope_namespace_config + delete_scope_namespace_config = parent_rpcs.delete_scope_namespace if parent_rpcs.respond_to? :delete_scope_namespace + @delete_scope_namespace = ::Gapic::Config::Method.new delete_scope_namespace_config + list_scope_namespaces_config = parent_rpcs.list_scope_namespaces if parent_rpcs.respond_to? :list_scope_namespaces + @list_scope_namespaces = ::Gapic::Config::Method.new list_scope_namespaces_config + get_scope_rbac_role_binding_config = parent_rpcs.get_scope_rbac_role_binding if parent_rpcs.respond_to? :get_scope_rbac_role_binding + @get_scope_rbac_role_binding = ::Gapic::Config::Method.new get_scope_rbac_role_binding_config + create_scope_rbac_role_binding_config = parent_rpcs.create_scope_rbac_role_binding if parent_rpcs.respond_to? :create_scope_rbac_role_binding + @create_scope_rbac_role_binding = ::Gapic::Config::Method.new create_scope_rbac_role_binding_config + update_scope_rbac_role_binding_config = parent_rpcs.update_scope_rbac_role_binding if parent_rpcs.respond_to? :update_scope_rbac_role_binding + @update_scope_rbac_role_binding = ::Gapic::Config::Method.new update_scope_rbac_role_binding_config + delete_scope_rbac_role_binding_config = parent_rpcs.delete_scope_rbac_role_binding if parent_rpcs.respond_to? :delete_scope_rbac_role_binding + @delete_scope_rbac_role_binding = ::Gapic::Config::Method.new delete_scope_rbac_role_binding_config + list_scope_rbac_role_bindings_config = parent_rpcs.list_scope_rbac_role_bindings if parent_rpcs.respond_to? :list_scope_rbac_role_bindings + @list_scope_rbac_role_bindings = ::Gapic::Config::Method.new list_scope_rbac_role_bindings_config + get_scope_config = parent_rpcs.get_scope if parent_rpcs.respond_to? :get_scope + @get_scope = ::Gapic::Config::Method.new get_scope_config + create_scope_config = parent_rpcs.create_scope if parent_rpcs.respond_to? :create_scope + @create_scope = ::Gapic::Config::Method.new create_scope_config + update_scope_config = parent_rpcs.update_scope if parent_rpcs.respond_to? :update_scope + @update_scope = ::Gapic::Config::Method.new update_scope_config + delete_scope_config = parent_rpcs.delete_scope if parent_rpcs.respond_to? :delete_scope + @delete_scope = ::Gapic::Config::Method.new delete_scope_config + list_scopes_config = parent_rpcs.list_scopes if parent_rpcs.respond_to? :list_scopes + @list_scopes = ::Gapic::Config::Method.new list_scopes_config + list_permitted_scopes_config = parent_rpcs.list_permitted_scopes if parent_rpcs.respond_to? :list_permitted_scopes + @list_permitted_scopes = ::Gapic::Config::Method.new list_permitted_scopes_config + get_membership_binding_config = parent_rpcs.get_membership_binding if parent_rpcs.respond_to? :get_membership_binding + @get_membership_binding = ::Gapic::Config::Method.new get_membership_binding_config + create_membership_binding_config = parent_rpcs.create_membership_binding if parent_rpcs.respond_to? :create_membership_binding + @create_membership_binding = ::Gapic::Config::Method.new create_membership_binding_config + update_membership_binding_config = parent_rpcs.update_membership_binding if parent_rpcs.respond_to? :update_membership_binding + @update_membership_binding = ::Gapic::Config::Method.new update_membership_binding_config + delete_membership_binding_config = parent_rpcs.delete_membership_binding if parent_rpcs.respond_to? :delete_membership_binding + @delete_membership_binding = ::Gapic::Config::Method.new delete_membership_binding_config + list_membership_bindings_config = parent_rpcs.list_membership_bindings if parent_rpcs.respond_to? :list_membership_bindings + @list_membership_bindings = ::Gapic::Config::Method.new list_membership_bindings_config + get_membership_rbac_role_binding_config = parent_rpcs.get_membership_rbac_role_binding if parent_rpcs.respond_to? :get_membership_rbac_role_binding + @get_membership_rbac_role_binding = ::Gapic::Config::Method.new get_membership_rbac_role_binding_config + create_membership_rbac_role_binding_config = parent_rpcs.create_membership_rbac_role_binding if parent_rpcs.respond_to? :create_membership_rbac_role_binding + @create_membership_rbac_role_binding = ::Gapic::Config::Method.new create_membership_rbac_role_binding_config + update_membership_rbac_role_binding_config = parent_rpcs.update_membership_rbac_role_binding if parent_rpcs.respond_to? :update_membership_rbac_role_binding + @update_membership_rbac_role_binding = ::Gapic::Config::Method.new update_membership_rbac_role_binding_config + delete_membership_rbac_role_binding_config = parent_rpcs.delete_membership_rbac_role_binding if parent_rpcs.respond_to? :delete_membership_rbac_role_binding + @delete_membership_rbac_role_binding = ::Gapic::Config::Method.new delete_membership_rbac_role_binding_config + list_membership_rbac_role_bindings_config = parent_rpcs.list_membership_rbac_role_bindings if parent_rpcs.respond_to? :list_membership_rbac_role_bindings + @list_membership_rbac_role_bindings = ::Gapic::Config::Method.new list_membership_rbac_role_bindings_config + generate_membership_rbac_role_binding_yaml_config = parent_rpcs.generate_membership_rbac_role_binding_yaml if parent_rpcs.respond_to? :generate_membership_rbac_role_binding_yaml + @generate_membership_rbac_role_binding_yaml = ::Gapic::Config::Method.new generate_membership_rbac_role_binding_yaml_config yield self if block_given? end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb index 394941422e6f..5c59d711a241 100644 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb @@ -113,6 +113,46 @@ def list_memberships request_pb, options = nil end end + ## + # Baseline implementation for the list_bound_memberships REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::ListBoundMembershipsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::ListBoundMembershipsResponse] + # A result object deserialized from the server's reply + def list_bound_memberships request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_bound_memberships_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, + method_name: "list_bound_memberships", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::ListBoundMembershipsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + ## # Baseline implementation for the list_features REST call # @@ -514,149 +554,1843 @@ def generate_connect_manifest request_pb, options = nil end ## - # @private - # - # GRPC transcoding helper method for the list_memberships REST call + # Baseline implementation for the create_fleet REST call # - # @param request_pb [::Google::Cloud::GkeHub::V1::ListMembershipsRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateFleetRequest] # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_memberships_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/memberships", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # GRPC transcoding helper method for the list_features REST call + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] # - # @param request_pb [::Google::Cloud::GkeHub::V1::ListFeaturesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_features_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/features", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_fleet request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_fleet_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, + method_name: "create_fleet", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end end ## - # @private + # Baseline implementation for the get_fleet REST call # - # GRPC transcoding helper method for the get_membership REST call - # - # @param request_pb [::Google::Cloud::GkeHub::V1::GetMembershipRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::GetFleetRequest] # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_membership_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # GRPC transcoding helper method for the get_feature REST call + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::Fleet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] # - # @param request_pb [::Google::Cloud::GkeHub::V1::GetFeatureRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_feature_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/features/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb + # @return [::Google::Cloud::GkeHub::V1::Fleet] + # A result object deserialized from the server's reply + def get_fleet request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_fleet_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, + method_name: "get_fleet", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::Fleet.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end end ## - # @private + # Baseline implementation for the update_fleet REST call # - # GRPC transcoding helper method for the create_membership REST call - # - # @param request_pb [::Google::Cloud::GkeHub::V1::CreateMembershipRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateFleetRequest] # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_membership_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/memberships", - body: "resource", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_fleet request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_fleet_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, + method_name: "update_fleet", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end end ## - # @private - # - # GRPC transcoding helper method for the create_feature REST call + # Baseline implementation for the delete_fleet REST call # - # @param request_pb [::Google::Cloud::GkeHub::V1::CreateFeatureRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteFleetRequest] # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_feature_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/features", - body: "resource", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_fleet request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_fleet_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, + method_name: "delete_fleet", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end end ## - # @private - # - # GRPC transcoding helper method for the delete_membership REST call + # Baseline implementation for the list_fleets REST call # - # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteMembershipRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::ListFleetsRequest] # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_membership_request request_pb + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::ListFleetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::ListFleetsResponse] + # A result object deserialized from the server's reply + def list_fleets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_fleets_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, + method_name: "list_fleets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::ListFleetsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_scope_namespace REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::Namespace] + # A result object deserialized from the server's reply + def get_scope_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_scope_namespace_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, + method_name: "get_scope_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::Namespace.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_scope_namespace REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_scope_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_scope_namespace_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, + method_name: "create_scope_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_scope_namespace REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_scope_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_scope_namespace_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, + method_name: "update_scope_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_scope_namespace REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_scope_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_scope_namespace_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, + method_name: "delete_scope_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_scope_namespaces REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::ListScopeNamespacesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::ListScopeNamespacesResponse] + # A result object deserialized from the server's reply + def list_scope_namespaces request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_scope_namespaces_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, + method_name: "list_scope_namespaces", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::ListScopeNamespacesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_scope_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # A result object deserialized from the server's reply + def get_scope_rbac_role_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_scope_rbac_role_binding_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, + method_name: "get_scope_rbac_role_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::RBACRoleBinding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_scope_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_scope_rbac_role_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_scope_rbac_role_binding_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, + method_name: "create_scope_rbac_role_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_scope_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_scope_rbac_role_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_scope_rbac_role_binding_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, + method_name: "update_scope_rbac_role_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_scope_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_scope_rbac_role_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_scope_rbac_role_binding_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, + method_name: "delete_scope_rbac_role_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_scope_rbac_role_bindings REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsResponse] + # A result object deserialized from the server's reply + def list_scope_rbac_role_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_scope_rbac_role_bindings_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, + method_name: "list_scope_rbac_role_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_scope REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetScopeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::Scope] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::Scope] + # A result object deserialized from the server's reply + def get_scope request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_scope_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, + method_name: "get_scope", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::Scope.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_scope REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateScopeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_scope request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_scope_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, + method_name: "create_scope", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_scope REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateScopeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_scope request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_scope_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, + method_name: "update_scope", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_scope REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteScopeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_scope request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_scope_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, + method_name: "delete_scope", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_scopes REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListScopesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::ListScopesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::ListScopesResponse] + # A result object deserialized from the server's reply + def list_scopes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_scopes_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, + method_name: "list_scopes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::ListScopesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_permitted_scopes REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::ListPermittedScopesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::ListPermittedScopesResponse] + # A result object deserialized from the server's reply + def list_permitted_scopes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_permitted_scopes_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, + method_name: "list_permitted_scopes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::ListPermittedScopesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_membership_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::MembershipBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::MembershipBinding] + # A result object deserialized from the server's reply + def get_membership_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_membership_binding_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, + method_name: "get_membership_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::MembershipBinding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_membership_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_membership_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_membership_binding_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, + method_name: "create_membership_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_membership_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_membership_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_membership_binding_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, + method_name: "update_membership_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_membership_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_membership_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_membership_binding_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, + method_name: "delete_membership_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_membership_bindings REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::ListMembershipBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::ListMembershipBindingsResponse] + # A result object deserialized from the server's reply + def list_membership_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_membership_bindings_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, + method_name: "list_membership_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::ListMembershipBindingsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_membership_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # A result object deserialized from the server's reply + def get_membership_rbac_role_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_membership_rbac_role_binding_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, + method_name: "get_membership_rbac_role_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::RBACRoleBinding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_membership_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_membership_rbac_role_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_membership_rbac_role_binding_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, + method_name: "create_membership_rbac_role_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_membership_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_membership_rbac_role_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_membership_rbac_role_binding_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, + method_name: "update_membership_rbac_role_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_membership_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_membership_rbac_role_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_membership_rbac_role_binding_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, + method_name: "delete_membership_rbac_role_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_membership_rbac_role_bindings REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsResponse] + # A result object deserialized from the server's reply + def list_membership_rbac_role_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_membership_rbac_role_bindings_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, + method_name: "list_membership_rbac_role_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the generate_membership_rbac_role_binding_yaml REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse] + # A result object deserialized from the server's reply + def generate_membership_rbac_role_binding_yaml request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_membership_rbac_role_binding_yaml_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, + method_name: "generate_membership_rbac_role_binding_yaml", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_memberships REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListMembershipsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_memberships_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/memberships", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_bound_memberships REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_bound_memberships_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{scope_name}:listMemberships", + matches: [ + ["scope_name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_features REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListFeaturesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_features_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/features", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_membership REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetMembershipRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_membership_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_feature REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetFeatureRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_membership REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateMembershipRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_membership_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/memberships", + body: "resource", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_feature REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateFeatureRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/features", + body: "resource", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_membership REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteMembershipRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_membership_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_feature REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteFeatureRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_membership REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateMembershipRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_membership_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{name}", + body: "resource", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_feature REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateFeatureRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{name}", + body: "resource", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_connect_manifest REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GenerateConnectManifestRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_generate_connect_manifest_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:generateConnectManifest", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_fleet REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateFleetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_fleet_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/fleets", + body: "fleet", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_fleet REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetFleetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_fleet_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/fleets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_fleet REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateFleetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_fleet_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{fleet.name}", + body: "fleet", + matches: [ + ["fleet.name", %r{^projects/[^/]+/locations/[^/]+/fleets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_fleet REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteFleetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_fleet_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/fleets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_fleets REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListFleetsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_fleets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/fleets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/fleets", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_scope_namespace REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_scope_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_scope_namespace REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_scope_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/namespaces", + body: "scope_namespace", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_scope_namespace REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_scope_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{scope_namespace.name}", + body: "scope_namespace", + matches: [ + ["scope_namespace.name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_scope_namespace REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_scope_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_scope_namespaces REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_scope_namespaces_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/namespaces", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_scope_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_scope_rbac_role_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/rbacrolebindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_scope_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_scope_rbac_role_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/rbacrolebindings", + body: "rbacrolebinding", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_scope_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_scope_rbac_role_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{rbacrolebinding.name}", + body: "rbacrolebinding", + matches: [ + ["rbacrolebinding.name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/rbacrolebindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_scope_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_scope_rbac_role_binding_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ["name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/rbacrolebindings/[^/]+/?$}, false] ] ) transcoder.transcode request_pb @@ -665,19 +2399,105 @@ def self.transcode_delete_membership_request request_pb ## # @private # - # GRPC transcoding helper method for the delete_feature REST call + # GRPC transcoding helper method for the list_scope_rbac_role_bindings REST call # - # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteFeatureRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_delete_feature_request request_pb + def self.transcode_list_scope_rbac_role_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/rbacrolebindings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_scope REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetScopeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_scope_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_scope REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateScopeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_scope_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/scopes", + body: "scope", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_scope REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateScopeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_scope_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{scope.name}", + body: "scope", + matches: [ + ["scope.name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_scope REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteScopeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_scope_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/features/[^/]+/?$}, false] + ["name", %r{^projects/[^/]+/locations/[^/]+/scopes/[^/]+/?$}, false] ] ) transcoder.transcode request_pb @@ -686,20 +2506,126 @@ def self.transcode_delete_feature_request request_pb ## # @private # - # GRPC transcoding helper method for the update_membership REST call + # GRPC transcoding helper method for the list_scopes REST call # - # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateMembershipRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::ListScopesRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_update_membership_request request_pb + def self.transcode_list_scopes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/scopes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_permitted_scopes REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_permitted_scopes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/scopes:listPermitted", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_membership_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_membership_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/bindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_membership_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_membership_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/bindings", + body: "membership_binding", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_membership_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_membership_binding_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :patch, + uri_template: "/v1/{membership_binding.name}", + body: "membership_binding", + matches: [ + ["membership_binding.name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/bindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_membership_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_membership_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, uri_template: "/v1/{name}", - body: "resource", matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/bindings/[^/]+/?$}, false] ] ) transcoder.transcode request_pb @@ -708,20 +2634,105 @@ def self.transcode_update_membership_request request_pb ## # @private # - # GRPC transcoding helper method for the update_feature REST call + # GRPC transcoding helper method for the list_membership_bindings REST call # - # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateFeatureRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_update_feature_request request_pb + def self.transcode_list_membership_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/bindings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_membership_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_membership_rbac_role_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/rbacrolebindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_membership_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_membership_rbac_role_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/rbacrolebindings", + body: "rbacrolebinding", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_membership_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_membership_rbac_role_binding_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :patch, + uri_template: "/v1/{rbacrolebinding.name}", + body: "rbacrolebinding", + matches: [ + ["rbacrolebinding.name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/rbacrolebindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_membership_rbac_role_binding REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_membership_rbac_role_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, uri_template: "/v1/{name}", - body: "resource", matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/features/[^/]+/?$}, false] + ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/rbacrolebindings/[^/]+/?$}, false] ] ) transcoder.transcode request_pb @@ -730,19 +2741,41 @@ def self.transcode_update_feature_request request_pb ## # @private # - # GRPC transcoding helper method for the generate_connect_manifest REST call + # GRPC transcoding helper method for the list_membership_rbac_role_bindings REST call # - # @param request_pb [::Google::Cloud::GkeHub::V1::GenerateConnectManifestRequest] + # @param request_pb [::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_generate_connect_manifest_request request_pb + def self.transcode_list_membership_rbac_role_bindings_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, - uri_template: "/v1/{name}:generateConnectManifest", + uri_template: "/v1/{parent}/rbacrolebindings", matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ["parent", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_membership_rbac_role_binding_yaml REST call + # + # @param request_pb [::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_generate_membership_rbac_role_binding_yaml_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/rbacrolebindings:generateMembershipRBACRoleBindingYAML", + body: "rbacrolebinding", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/memberships/[^/]+/?$}, false] ] ) transcoder.transcode request_pb diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/configmanagement/configmanagement_pb.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/configmanagement/configmanagement_pb.rb deleted file mode 100644 index 70d524437a2f..000000000000 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/configmanagement/configmanagement_pb.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/gkehub/v1/configmanagement/configmanagement.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n>google/cloud/gkehub/v1/configmanagement/configmanagement.proto\x12\'google.cloud.gkehub.configmanagement.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x03\n\x0fMembershipState\x12\x14\n\x0c\x63luster_name\x18\x01 \x01(\t\x12P\n\x0fmembership_spec\x18\x02 \x01(\x0b\x32\x37.google.cloud.gkehub.configmanagement.v1.MembershipSpec\x12N\n\x0eoperator_state\x18\x03 \x01(\x0b\x32\x36.google.cloud.gkehub.configmanagement.v1.OperatorState\x12S\n\x11\x63onfig_sync_state\x18\x04 \x01(\x0b\x32\x38.google.cloud.gkehub.configmanagement.v1.ConfigSyncState\x12_\n\x17policy_controller_state\x18\x05 \x01(\x0b\x32>.google.cloud.gkehub.configmanagement.v1.PolicyControllerState\x12\x65\n\x1ahierarchy_controller_state\x18\x07 \x01(\x0b\x32\x41.google.cloud.gkehub.configmanagement.v1.HierarchyControllerState\"\xe7\x03\n\x0eMembershipSpec\x12H\n\x0b\x63onfig_sync\x18\x01 \x01(\x0b\x32\x33.google.cloud.gkehub.configmanagement.v1.ConfigSync\x12T\n\x11policy_controller\x18\x02 \x01(\x0b\x32\x39.google.cloud.gkehub.configmanagement.v1.PolicyController\x12`\n\x14hierarchy_controller\x18\x04 \x01(\x0b\x32\x42.google.cloud.gkehub.configmanagement.v1.HierarchyControllerConfig\x12\x0f\n\x07version\x18\n \x01(\t\x12\x0f\n\x07\x63luster\x18\x0b \x01(\t\x12V\n\nmanagement\x18\x0c \x01(\x0e\x32\x42.google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management\"Y\n\nManagement\x12\x1a\n\x16MANAGEMENT_UNSPECIFIED\x10\x00\x12\x18\n\x14MANAGEMENT_AUTOMATIC\x10\x01\x12\x15\n\x11MANAGEMENT_MANUAL\x10\x02\"\x89\x02\n\nConfigSync\x12?\n\x03git\x18\x07 \x01(\x0b\x32\x32.google.cloud.gkehub.configmanagement.v1.GitConfig\x12\x15\n\rsource_format\x18\x08 \x01(\t\x12\x14\n\x07\x65nabled\x18\n \x01(\x08H\x00\x88\x01\x01\x12\x15\n\rprevent_drift\x18\x0b \x01(\x08\x12?\n\x03oci\x18\x0c \x01(\x0b\x32\x32.google.cloud.gkehub.configmanagement.v1.OciConfig\x12)\n!metrics_gcp_service_account_email\x18\x0f \x01(\tB\n\n\x08_enabled\"\xbe\x01\n\tGitConfig\x12\x11\n\tsync_repo\x18\x01 \x01(\t\x12\x13\n\x0bsync_branch\x18\x02 \x01(\t\x12\x12\n\npolicy_dir\x18\x03 \x01(\t\x12\x16\n\x0esync_wait_secs\x18\x04 \x01(\x03\x12\x10\n\x08sync_rev\x18\x05 \x01(\t\x12\x13\n\x0bsecret_type\x18\x06 \x01(\t\x12\x13\n\x0bhttps_proxy\x18\x07 \x01(\t\x12!\n\x19gcp_service_account_email\x18\x08 \x01(\t\"\x82\x01\n\tOciConfig\x12\x11\n\tsync_repo\x18\x01 \x01(\t\x12\x12\n\npolicy_dir\x18\x02 \x01(\t\x12\x16\n\x0esync_wait_secs\x18\x03 \x01(\x03\x12\x13\n\x0bsecret_type\x18\x04 \x01(\t\x12!\n\x19gcp_service_account_email\x18\x05 \x01(\t\"\x89\x02\n\x10PolicyController\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\'\n\x1atemplate_library_installed\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12#\n\x16\x61udit_interval_seconds\x18\x03 \x01(\x03H\x01\x88\x01\x01\x12\x1d\n\x15\x65xemptable_namespaces\x18\x04 \x03(\t\x12!\n\x19referential_rules_enabled\x18\x05 \x01(\x08\x12\x1a\n\x12log_denies_enabled\x18\x06 \x01(\x08\x42\x1d\n\x1b_template_library_installedB\x19\n\x17_audit_interval_seconds\"x\n\x19HierarchyControllerConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x1e\n\x16\x65nable_pod_tree_labels\x18\x02 \x01(\x08\x12*\n\"enable_hierarchical_resource_quota\x18\x03 \x01(\x08\"\xb8\x01\n\"HierarchyControllerDeploymentState\x12\x45\n\x03hnc\x18\x01 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12K\n\textension\x18\x02 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\"<\n\x1aHierarchyControllerVersion\x12\x0b\n\x03hnc\x18\x01 \x01(\t\x12\x11\n\textension\x18\x02 \x01(\t\"\xcc\x01\n\x18HierarchyControllerState\x12T\n\x07version\x18\x01 \x01(\x0b\x32\x43.google.cloud.gkehub.configmanagement.v1.HierarchyControllerVersion\x12Z\n\x05state\x18\x02 \x01(\x0b\x32K.google.cloud.gkehub.configmanagement.v1.HierarchyControllerDeploymentState\"\xbb\x01\n\rOperatorState\x12\x0f\n\x07version\x18\x01 \x01(\t\x12R\n\x10\x64\x65ployment_state\x18\x02 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12\x45\n\x06\x65rrors\x18\x03 \x03(\x0b\x32\x35.google.cloud.gkehub.configmanagement.v1.InstallError\"%\n\x0cInstallError\x12\x15\n\rerror_message\x18\x01 \x01(\t\"\xc4\x06\n\x0f\x43onfigSyncState\x12K\n\x07version\x18\x01 \x01(\x0b\x32:.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion\x12\\\n\x10\x64\x65ployment_state\x18\x02 \x01(\x0b\x32\x42.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState\x12\x46\n\nsync_state\x18\x03 \x01(\x0b\x32\x32.google.cloud.gkehub.configmanagement.v1.SyncState\x12H\n\x06\x65rrors\x18\x04 \x03(\x0b\x32\x38.google.cloud.gkehub.configmanagement.v1.ConfigSyncError\x12W\n\x0crootsync_crd\x18\x05 \x01(\x0e\x32\x41.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState\x12W\n\x0creposync_crd\x18\x06 \x01(\x0e\x32\x41.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState\x12M\n\x05state\x18\x07 \x01(\x0e\x32>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State\"h\n\x08\x43RDState\x12\x19\n\x15\x43RD_STATE_UNSPECIFIED\x10\x00\x12\x11\n\rNOT_INSTALLED\x10\x01\x12\r\n\tINSTALLED\x10\x02\x12\x0f\n\x0bTERMINATING\x10\x03\x12\x0e\n\nINSTALLING\x10\x04\"\x88\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x43ONFIG_SYNC_NOT_INSTALLED\x10\x01\x12\x19\n\x15\x43ONFIG_SYNC_INSTALLED\x10\x02\x12\x15\n\x11\x43ONFIG_SYNC_ERROR\x10\x03\x12\x17\n\x13\x43ONFIG_SYNC_PENDING\x10\x04\"(\n\x0f\x43onfigSyncError\x12\x15\n\rerror_message\x18\x01 \x01(\t\"\xa8\x01\n\x11\x43onfigSyncVersion\x12\x10\n\x08importer\x18\x01 \x01(\t\x12\x0e\n\x06syncer\x18\x02 \x01(\t\x12\x10\n\x08git_sync\x18\x03 \x01(\t\x12\x0f\n\x07monitor\x18\x04 \x01(\t\x12\x1a\n\x12reconciler_manager\x18\x05 \x01(\t\x12\x17\n\x0froot_reconciler\x18\x06 \x01(\t\x12\x19\n\x11\x61\x64mission_webhook\x18\x07 \x01(\t\"\xc6\x04\n\x19\x43onfigSyncDeploymentState\x12J\n\x08importer\x18\x01 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12H\n\x06syncer\x18\x02 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12J\n\x08git_sync\x18\x03 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12I\n\x07monitor\x18\x04 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12T\n\x12reconciler_manager\x18\x05 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12Q\n\x0froot_reconciler\x18\x06 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12S\n\x11\x61\x64mission_webhook\x18\x07 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\"\xbb\x03\n\tSyncState\x12\x14\n\x0csource_token\x18\x01 \x01(\t\x12\x14\n\x0cimport_token\x18\x02 \x01(\t\x12\x12\n\nsync_token\x18\x03 \x01(\t\x12\x15\n\tlast_sync\x18\x04 \x01(\tB\x02\x18\x01\x12\x32\n\x0elast_sync_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12I\n\x04\x63ode\x18\x05 \x01(\x0e\x32;.google.cloud.gkehub.configmanagement.v1.SyncState.SyncCode\x12\x42\n\x06\x65rrors\x18\x06 \x03(\x0b\x32\x32.google.cloud.gkehub.configmanagement.v1.SyncError\"\x93\x01\n\x08SyncCode\x12\x19\n\x15SYNC_CODE_UNSPECIFIED\x10\x00\x12\n\n\x06SYNCED\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\x12\n\x0eNOT_CONFIGURED\x10\x04\x12\x11\n\rNOT_INSTALLED\x10\x05\x12\x10\n\x0cUNAUTHORIZED\x10\x06\x12\x0f\n\x0bUNREACHABLE\x10\x07\"\x81\x01\n\tSyncError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\x15\n\rerror_message\x18\x02 \x01(\t\x12O\n\x0f\x65rror_resources\x18\x03 \x03(\x0b\x32\x36.google.cloud.gkehub.configmanagement.v1.ErrorResource\"\xa8\x01\n\rErrorResource\x12\x13\n\x0bsource_path\x18\x01 \x01(\t\x12\x15\n\rresource_name\x18\x02 \x01(\t\x12\x1a\n\x12resource_namespace\x18\x03 \x01(\t\x12O\n\x0cresource_gvk\x18\x04 \x01(\x0b\x32\x39.google.cloud.gkehub.configmanagement.v1.GroupVersionKind\"@\n\x10GroupVersionKind\x12\r\n\x05group\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0c\n\x04kind\x18\x03 \x01(\t\"\xc8\x01\n\x15PolicyControllerState\x12Q\n\x07version\x18\x01 \x01(\x0b\x32@.google.cloud.gkehub.configmanagement.v1.PolicyControllerVersion\x12\\\n\x10\x64\x65ployment_state\x18\x02 \x01(\x0b\x32\x42.google.cloud.gkehub.configmanagement.v1.GatekeeperDeploymentState\"*\n\x17PolicyControllerVersion\x12\x0f\n\x07version\x18\x01 \x01(\t\"\xd6\x01\n\x19GatekeeperDeploymentState\x12\x65\n#gatekeeper_controller_manager_state\x18\x01 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState\x12R\n\x10gatekeeper_audit\x18\x02 \x01(\x0e\x32\x38.google.cloud.gkehub.configmanagement.v1.DeploymentState*m\n\x0f\x44\x65ploymentState\x12 \n\x1c\x44\x45PLOYMENT_STATE_UNSPECIFIED\x10\x00\x12\x11\n\rNOT_INSTALLED\x10\x01\x12\r\n\tINSTALLED\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\x0b\n\x07PENDING\x10\x04\x42\xa1\x02\n+com.google.cloud.gkehub.configmanagement.v1B\x15\x43onfigManagementProtoP\x01ZWcloud.google.com/go/gkehub/configmanagement/apiv1/configmanagementpb;configmanagementpb\xaa\x02\'Google.Cloud.GkeHub.ConfigManagement.V1\xca\x02\'Google\\Cloud\\GkeHub\\ConfigManagement\\V1\xea\x02+Google::Cloud::GkeHub::ConfigManagement::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module GkeHub - module ConfigManagement - module V1 - MembershipState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.MembershipState").msgclass - MembershipSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.MembershipSpec").msgclass - MembershipSpec::Management = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management").enummodule - ConfigSync = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.ConfigSync").msgclass - GitConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.GitConfig").msgclass - OciConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.OciConfig").msgclass - PolicyController = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.PolicyController").msgclass - HierarchyControllerConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.HierarchyControllerConfig").msgclass - HierarchyControllerDeploymentState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.HierarchyControllerDeploymentState").msgclass - HierarchyControllerVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.HierarchyControllerVersion").msgclass - HierarchyControllerState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.HierarchyControllerState").msgclass - OperatorState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.OperatorState").msgclass - InstallError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.InstallError").msgclass - ConfigSyncState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.ConfigSyncState").msgclass - ConfigSyncState::CRDState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState").enummodule - ConfigSyncState::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State").enummodule - ConfigSyncError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.ConfigSyncError").msgclass - ConfigSyncVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion").msgclass - ConfigSyncDeploymentState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState").msgclass - SyncState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.SyncState").msgclass - SyncState::SyncCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.SyncState.SyncCode").enummodule - SyncError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.SyncError").msgclass - ErrorResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.ErrorResource").msgclass - GroupVersionKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.GroupVersionKind").msgclass - PolicyControllerState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.PolicyControllerState").msgclass - PolicyControllerVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.PolicyControllerVersion").msgclass - GatekeeperDeploymentState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.GatekeeperDeploymentState").msgclass - DeploymentState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.configmanagement.v1.DeploymentState").enummodule - end - end - end - end -end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/feature_pb.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/feature_pb.rb index 9e617b6a55ca..b7bc160f35dd 100644 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/feature_pb.rb +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/feature_pb.rb @@ -8,10 +8,11 @@ require 'google/api/resource_pb' require 'google/cloud/gkehub/v1/configmanagement/configmanagement_pb' require 'google/cloud/gkehub/v1/multiclusteringress/multiclusteringress_pb' +require 'google/cloud/gkehub/v1/rbacrolebindingactuation/rbacrolebindingactuation_pb' require 'google/protobuf/timestamp_pb' -descriptor_data = "\n$google/cloud/gkehub/v1/feature.proto\x12\x16google.cloud.gkehub.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a>google/cloud/gkehub/v1/configmanagement/configmanagement.proto\x1a\x44google/cloud/gkehub/v1/multiclusteringress/multiclusteringress.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcf\x07\n\x07\x46\x65\x61ture\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12;\n\x06labels\x18\x02 \x03(\x0b\x32+.google.cloud.gkehub.v1.Feature.LabelsEntry\x12I\n\x0eresource_state\x18\x03 \x01(\x0b\x32,.google.cloud.gkehub.v1.FeatureResourceStateB\x03\xe0\x41\x03\x12<\n\x04spec\x18\x04 \x01(\x0b\x32).google.cloud.gkehub.v1.CommonFeatureSpecB\x03\xe0\x41\x01\x12S\n\x10membership_specs\x18\x05 \x03(\x0b\x32\x34.google.cloud.gkehub.v1.Feature.MembershipSpecsEntryB\x03\xe0\x41\x01\x12>\n\x05state\x18\x06 \x01(\x0b\x32*.google.cloud.gkehub.v1.CommonFeatureStateB\x03\xe0\x41\x03\x12U\n\x11membership_states\x18\x07 \x03(\x0b\x32\x35.google.cloud.gkehub.v1.Feature.MembershipStatesEntryB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x65\n\x14MembershipSpecsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.google.cloud.gkehub.v1.MembershipFeatureSpec:\x02\x38\x01\x1ag\n\x15MembershipStatesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.gkehub.v1.MembershipFeatureState:\x02\x38\x01:^\xea\x41[\n\x1dgkehub.googleapis.com/Feature\x12:projects/{project}/locations/{location}/features/{feature}\"\xc6\x01\n\x14\x46\x65\x61tureResourceState\x12\x41\n\x05state\x18\x01 \x01(\x0e\x32\x32.google.cloud.gkehub.v1.FeatureResourceState.State\"k\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x45NABLING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\r\n\tDISABLING\x10\x03\x12\x0c\n\x08UPDATING\x10\x04\x12\x14\n\x10SERVICE_UPDATING\x10\x05\"\xcb\x01\n\x0c\x46\x65\x61tureState\x12\x37\n\x04\x63ode\x18\x01 \x01(\x0e\x32).google.cloud.gkehub.v1.FeatureState.Code\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"<\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\"{\n\x11\x43ommonFeatureSpec\x12V\n\x13multiclusteringress\x18\x66 \x01(\x0b\x32\x37.google.cloud.gkehub.multiclusteringress.v1.FeatureSpecH\x00\x42\x0e\n\x0c\x66\x65\x61ture_spec\"N\n\x12\x43ommonFeatureState\x12\x38\n\x05state\x18\x01 \x01(\x0b\x32$.google.cloud.gkehub.v1.FeatureStateB\x03\xe0\x41\x03\"|\n\x15MembershipFeatureSpec\x12S\n\x10\x63onfigmanagement\x18j \x01(\x0b\x32\x37.google.cloud.gkehub.configmanagement.v1.MembershipSpecH\x00\x42\x0e\n\x0c\x66\x65\x61ture_spec\"\xb4\x01\n\x16MembershipFeatureState\x12T\n\x10\x63onfigmanagement\x18j \x01(\x0b\x32\x38.google.cloud.gkehub.configmanagement.v1.MembershipStateH\x00\x12\x33\n\x05state\x18\x01 \x01(\x0b\x32$.google.cloud.gkehub.v1.FeatureStateB\x0f\n\rfeature_stateB\xae\x01\n\x1a\x63om.google.cloud.gkehub.v1B\x0c\x46\x65\x61tureProtoP\x01Z2cloud.google.com/go/gkehub/apiv1/gkehubpb;gkehubpb\xaa\x02\x16Google.Cloud.GkeHub.V1\xca\x02\x16Google\\Cloud\\GkeHub\\V1\xea\x02\x19Google::Cloud::GkeHub::V1b\x06proto3" +descriptor_data = "\n$google/cloud/gkehub/v1/feature.proto\x12\x16google.cloud.gkehub.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a>google/cloud/gkehub/v1/configmanagement/configmanagement.proto\x1a\x44google/cloud/gkehub/v1/multiclusteringress/multiclusteringress.proto\x1aNgoogle/cloud/gkehub/v1/rbacrolebindingactuation/rbacrolebindingactuation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\n\n\x07\x46\x65\x61ture\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12;\n\x06labels\x18\x02 \x03(\x0b\x32+.google.cloud.gkehub.v1.Feature.LabelsEntry\x12I\n\x0eresource_state\x18\x03 \x01(\x0b\x32,.google.cloud.gkehub.v1.FeatureResourceStateB\x03\xe0\x41\x03\x12<\n\x04spec\x18\x04 \x01(\x0b\x32).google.cloud.gkehub.v1.CommonFeatureSpecB\x03\xe0\x41\x01\x12S\n\x10membership_specs\x18\x05 \x03(\x0b\x32\x34.google.cloud.gkehub.v1.Feature.MembershipSpecsEntryB\x03\xe0\x41\x01\x12>\n\x05state\x18\x06 \x01(\x0b\x32*.google.cloud.gkehub.v1.CommonFeatureStateB\x03\xe0\x41\x03\x12U\n\x11membership_states\x18\x07 \x03(\x0b\x32\x35.google.cloud.gkehub.v1.Feature.MembershipStatesEntryB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x0bscope_specs\x18\x0c \x03(\x0b\x32/.google.cloud.gkehub.v1.Feature.ScopeSpecsEntryB\x03\xe0\x41\x01\x12K\n\x0cscope_states\x18\r \x03(\x0b\x32\x30.google.cloud.gkehub.v1.Feature.ScopeStatesEntryB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x0f \x03(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x65\n\x14MembershipSpecsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.google.cloud.gkehub.v1.MembershipFeatureSpec:\x02\x38\x01\x1ag\n\x15MembershipStatesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.gkehub.v1.MembershipFeatureState:\x02\x38\x01\x1a[\n\x0fScopeSpecsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.google.cloud.gkehub.v1.ScopeFeatureSpec:\x02\x38\x01\x1a]\n\x10ScopeStatesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.gkehub.v1.ScopeFeatureState:\x02\x38\x01:^\xea\x41[\n\x1dgkehub.googleapis.com/Feature\x12:projects/{project}/locations/{location}/features/{feature}\"\xc6\x01\n\x14\x46\x65\x61tureResourceState\x12\x41\n\x05state\x18\x01 \x01(\x0e\x32\x32.google.cloud.gkehub.v1.FeatureResourceState.State\"k\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x45NABLING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\r\n\tDISABLING\x10\x03\x12\x0c\n\x08UPDATING\x10\x04\x12\x14\n\x10SERVICE_UPDATING\x10\x05\"\xcb\x01\n\x0c\x46\x65\x61tureState\x12\x37\n\x04\x63ode\x18\x01 \x01(\x0e\x32).google.cloud.gkehub.v1.FeatureState.Code\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"<\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\"{\n\x11\x43ommonFeatureSpec\x12V\n\x13multiclusteringress\x18\x66 \x01(\x0b\x32\x37.google.cloud.gkehub.multiclusteringress.v1.FeatureSpecH\x00\x42\x0e\n\x0c\x66\x65\x61ture_spec\"\xc2\x01\n\x12\x43ommonFeatureState\x12\x61\n\x18rbacrolebindingactuation\x18x \x01(\x0b\x32=.google.cloud.gkehub.rbacrolebindingactuation.v1.FeatureStateH\x00\x12\x38\n\x05state\x18\x01 \x01(\x0b\x32$.google.cloud.gkehub.v1.FeatureStateB\x03\xe0\x41\x03\x42\x0f\n\rfeature_state\"\x12\n\x10ScopeFeatureSpec\"M\n\x11ScopeFeatureState\x12\x38\n\x05state\x18\x01 \x01(\x0b\x32$.google.cloud.gkehub.v1.FeatureStateB\x03\xe0\x41\x03\"|\n\x15MembershipFeatureSpec\x12S\n\x10\x63onfigmanagement\x18j \x01(\x0b\x32\x37.google.cloud.gkehub.configmanagement.v1.MembershipSpecH\x00\x42\x0e\n\x0c\x66\x65\x61ture_spec\"\xb4\x01\n\x16MembershipFeatureState\x12T\n\x10\x63onfigmanagement\x18j \x01(\x0b\x32\x38.google.cloud.gkehub.configmanagement.v1.MembershipStateH\x00\x12\x33\n\x05state\x18\x01 \x01(\x0b\x32$.google.cloud.gkehub.v1.FeatureStateB\x0f\n\rfeature_stateB\xae\x01\n\x1a\x63om.google.cloud.gkehub.v1B\x0c\x46\x65\x61tureProtoP\x01Z2cloud.google.com/go/gkehub/apiv1/gkehubpb;gkehubpb\xaa\x02\x16Google.Cloud.GkeHub.V1\xca\x02\x16Google\\Cloud\\GkeHub\\V1\xea\x02\x19Google::Cloud::GkeHub::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -28,6 +29,7 @@ imports = [ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], ["google.cloud.gkehub.multiclusteringress.v1.FeatureSpec", "google/cloud/gkehub/v1/multiclusteringress/multiclusteringress.proto"], + ["google.cloud.gkehub.rbacrolebindingactuation.v1.FeatureState", "google/cloud/gkehub/v1/rbacrolebindingactuation/rbacrolebindingactuation.proto"], ["google.cloud.gkehub.configmanagement.v1.MembershipSpec", "google/cloud/gkehub/v1/configmanagement/configmanagement.proto"], ] imports.each do |type_name, expected_filename| @@ -51,6 +53,8 @@ module V1 FeatureState::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.FeatureState.Code").enummodule CommonFeatureSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CommonFeatureSpec").msgclass CommonFeatureState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CommonFeatureState").msgclass + ScopeFeatureSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ScopeFeatureSpec").msgclass + ScopeFeatureState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ScopeFeatureState").msgclass MembershipFeatureSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.MembershipFeatureSpec").msgclass MembershipFeatureState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.MembershipFeatureState").msgclass end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/fleet_pb.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/fleet_pb.rb new file mode 100644 index 000000000000..e76a78ad93f6 --- /dev/null +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/fleet_pb.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/gkehub/v1/fleet.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\"google/cloud/gkehub/v1/fleet.proto\x12\x16google.cloud.gkehub.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8a\x05\n\x05\x46leet\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12?\n\x05state\x18\t \x01(\x0b\x32+.google.cloud.gkehub.v1.FleetLifecycleStateB\x03\xe0\x41\x03\x12Q\n\x16\x64\x65\x66\x61ult_cluster_config\x18\n \x01(\x0b\x32,.google.cloud.gkehub.v1.DefaultClusterConfigB\x03\xe0\x41\x01\x12>\n\x06labels\x18\x0b \x03(\x0b\x32).google.cloud.gkehub.v1.Fleet.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x9b\x01\xea\x41\x97\x01\n\x1bgkehub.googleapis.com/Fleet\x12\x36projects/{project}/locations/{location}/fleets/{fleet}\x12@organizations/{organization}/locations/{location}/fleets/{fleet}\"\x9c\x02\n\x14\x44\x65\x66\x61ultClusterConfig\x12N\n\x17security_posture_config\x18\x01 \x01(\x0b\x32-.google.cloud.gkehub.v1.SecurityPostureConfig\x12[\n\x1b\x62inary_authorization_config\x18\x02 \x01(\x0b\x32\x31.google.cloud.gkehub.v1.BinaryAuthorizationConfigB\x03\xe0\x41\x01\x12W\n\x19\x63ompliance_posture_config\x18\x03 \x01(\x0b\x32/.google.cloud.gkehub.v1.CompliancePostureConfigB\x03\xe0\x41\x01\"\x8a\x03\n\x15SecurityPostureConfig\x12@\n\x04mode\x18\x01 \x01(\x0e\x32\x32.google.cloud.gkehub.v1.SecurityPostureConfig.Mode\x12[\n\x12vulnerability_mode\x18\x02 \x01(\x0e\x32?.google.cloud.gkehub.v1.SecurityPostureConfig.VulnerabilityMode\"E\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\t\n\x05\x42\x41SIC\x10\x02\x12\x0e\n\nENTERPRISE\x10\x03\"\x8a\x01\n\x11VulnerabilityMode\x12\"\n\x1eVULNERABILITY_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16VULNERABILITY_DISABLED\x10\x01\x12\x17\n\x13VULNERABILITY_BASIC\x10\x02\x12\x1c\n\x18VULNERABILITY_ENTERPRISE\x10\x03\"\xcf\x02\n\x19\x42inaryAuthorizationConfig\x12^\n\x0f\x65valuation_mode\x18\x01 \x01(\x0e\x32@.google.cloud.gkehub.v1.BinaryAuthorizationConfig.EvaluationModeB\x03\xe0\x41\x01\x12]\n\x0fpolicy_bindings\x18\x02 \x03(\x0b\x32?.google.cloud.gkehub.v1.BinaryAuthorizationConfig.PolicyBindingB\x03\xe0\x41\x01\x1a\x1d\n\rPolicyBinding\x12\x0c\n\x04name\x18\x01 \x01(\t\"T\n\x0e\x45valuationMode\x12\x1f\n\x1b\x45VALUATION_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x13\n\x0fPOLICY_BINDINGS\x10\x02\"\xa0\x02\n\x17\x43ompliancePostureConfig\x12\x42\n\x04mode\x18\x01 \x01(\x0e\x32\x34.google.cloud.gkehub.v1.CompliancePostureConfig.Mode\x12`\n\x14\x63ompliance_standards\x18\x02 \x03(\x0b\x32\x42.google.cloud.gkehub.v1.CompliancePostureConfig.ComplianceStandard\x1a&\n\x12\x43omplianceStandard\x12\x10\n\x08standard\x18\x01 \x01(\t\"7\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\"\xad\x01\n\x13\x46leetLifecycleState\x12\x43\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x30.google.cloud.gkehub.v1.FleetLifecycleState.CodeB\x03\xe0\x41\x03\"Q\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0c\n\x08UPDATING\x10\x04\"\xbd\x05\n\tNamespace\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x05state\x18\x06 \x01(\x0b\x32/.google.cloud.gkehub.v1.NamespaceLifecycleStateB\x03\xe0\x41\x03\x12\x32\n\x05scope\x18\x08 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bgkehub.googleapis.com/Scope\x12U\n\x10namespace_labels\x18\t \x03(\x0b\x32\x36.google.cloud.gkehub.v1.Namespace.NamespaceLabelsEntryB\x03\xe0\x41\x01\x12\x42\n\x06labels\x18\n \x03(\x0b\x32-.google.cloud.gkehub.v1.Namespace.LabelsEntryB\x03\xe0\x41\x01\x1a\x36\n\x14NamespaceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:s\xea\x41p\n\x1fgkehub.googleapis.com/Namespace\x12Mprojects/{project}/locations/{location}/scopes/{scope}/namespaces/{namespace}\"\xb5\x01\n\x17NamespaceLifecycleState\x12G\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x34.google.cloud.gkehub.v1.NamespaceLifecycleState.CodeB\x03\xe0\x41\x03\"Q\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0c\n\x08UPDATING\x10\x04\"\xc1\x07\n\x0fRBACRoleBinding\x12\x0e\n\x04user\x18\x07 \x01(\tH\x00\x12\x0f\n\x05group\x18\x08 \x01(\tH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x05state\x18\x06 \x01(\x0b\x32\x35.google.cloud.gkehub.v1.RBACRoleBindingLifecycleStateB\x03\xe0\x41\x03\x12?\n\x04role\x18\t \x01(\x0b\x32,.google.cloud.gkehub.v1.RBACRoleBinding.RoleB\x03\xe0\x41\x02\x12H\n\x06labels\x18\n \x03(\x0b\x32\x33.google.cloud.gkehub.v1.RBACRoleBinding.LabelsEntryB\x03\xe0\x41\x01\x1a\xca\x01\n\x04Role\x12U\n\x0fpredefined_role\x18\x01 \x01(\x0e\x32<.google.cloud.gkehub.v1.RBACRoleBinding.Role.PredefinedRoles\x12\x18\n\x0b\x63ustom_role\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Q\n\x0fPredefinedRoles\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05\x41\x44MIN\x10\x01\x12\x08\n\x04\x45\x44IT\x10\x02\x12\x08\n\x04VIEW\x10\x03\x12\x12\n\x0e\x41NTHOS_SUPPORT\x10\x04\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xeb\x01\xea\x41\xe7\x01\n%gkehub.googleapis.com/RBACRoleBinding\x12Yprojects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}\x12\x63projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding}B\x0b\n\tprincipal\"\xc1\x01\n\x1dRBACRoleBindingLifecycleState\x12M\n\x04\x63ode\x18\x01 \x01(\x0e\x32:.google.cloud.gkehub.v1.RBACRoleBindingLifecycleState.CodeB\x03\xe0\x41\x03\"Q\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0c\n\x08UPDATING\x10\x04\"\xde\x04\n\x05Scope\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x05state\x18\x06 \x01(\x0b\x32+.google.cloud.gkehub.v1.ScopeLifecycleStateB\x03\xe0\x41\x03\x12Q\n\x10namespace_labels\x18\x08 \x03(\x0b\x32\x32.google.cloud.gkehub.v1.Scope.NamespaceLabelsEntryB\x03\xe0\x41\x01\x12>\n\x06labels\x18\t \x03(\x0b\x32).google.cloud.gkehub.v1.Scope.LabelsEntryB\x03\xe0\x41\x01\x1a\x36\n\x14NamespaceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:X\xea\x41U\n\x1bgkehub.googleapis.com/Scope\x12\x36projects/{project}/locations/{location}/scopes/{scope}\"\xad\x01\n\x13ScopeLifecycleState\x12\x43\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x30.google.cloud.gkehub.v1.ScopeLifecycleState.CodeB\x03\xe0\x41\x03\"Q\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0c\n\x08UPDATING\x10\x04\"\xe9\x04\n\x11MembershipBinding\x12\x31\n\x05scope\x18\x03 \x01(\tB \xfa\x41\x1d\n\x1bgkehub.googleapis.com/ScopeH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12K\n\x05state\x18\x08 \x01(\x0b\x32\x37.google.cloud.gkehub.v1.MembershipBindingLifecycleStateB\x03\xe0\x41\x03\x12J\n\x06labels\x18\t \x03(\x0b\x32\x35.google.cloud.gkehub.v1.MembershipBinding.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x8c\x01\xea\x41\x88\x01\n\'gkehub.googleapis.com/MembershipBinding\x12]projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}B\x08\n\x06target\"\xc5\x01\n\x1fMembershipBindingLifecycleState\x12O\n\x04\x63ode\x18\x01 \x01(\x0e\x32<.google.cloud.gkehub.v1.MembershipBindingLifecycleState.CodeB\x03\xe0\x41\x03\"Q\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0c\n\x08UPDATING\x10\x04\x42\xac\x01\n\x1a\x63om.google.cloud.gkehub.v1B\nFleetProtoP\x01Z2cloud.google.com/go/gkehub/apiv1/gkehubpb;gkehubpb\xaa\x02\x16Google.Cloud.GkeHub.V1\xca\x02\x16Google\\Cloud\\GkeHub\\V1\xea\x02\x19Google::Cloud::GkeHub::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module GkeHub + module V1 + Fleet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.Fleet").msgclass + DefaultClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DefaultClusterConfig").msgclass + SecurityPostureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.SecurityPostureConfig").msgclass + SecurityPostureConfig::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.SecurityPostureConfig.Mode").enummodule + SecurityPostureConfig::VulnerabilityMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.SecurityPostureConfig.VulnerabilityMode").enummodule + BinaryAuthorizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.BinaryAuthorizationConfig").msgclass + BinaryAuthorizationConfig::PolicyBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.BinaryAuthorizationConfig.PolicyBinding").msgclass + BinaryAuthorizationConfig::EvaluationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.BinaryAuthorizationConfig.EvaluationMode").enummodule + CompliancePostureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CompliancePostureConfig").msgclass + CompliancePostureConfig::ComplianceStandard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CompliancePostureConfig.ComplianceStandard").msgclass + CompliancePostureConfig::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CompliancePostureConfig.Mode").enummodule + FleetLifecycleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.FleetLifecycleState").msgclass + FleetLifecycleState::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.FleetLifecycleState.Code").enummodule + Namespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.Namespace").msgclass + NamespaceLifecycleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.NamespaceLifecycleState").msgclass + NamespaceLifecycleState::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.NamespaceLifecycleState.Code").enummodule + RBACRoleBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.RBACRoleBinding").msgclass + RBACRoleBinding::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.RBACRoleBinding.Role").msgclass + RBACRoleBinding::Role::PredefinedRoles = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.RBACRoleBinding.Role.PredefinedRoles").enummodule + RBACRoleBindingLifecycleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.RBACRoleBindingLifecycleState").msgclass + RBACRoleBindingLifecycleState::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.RBACRoleBindingLifecycleState.Code").enummodule + Scope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.Scope").msgclass + ScopeLifecycleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ScopeLifecycleState").msgclass + ScopeLifecycleState::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ScopeLifecycleState.Code").enummodule + MembershipBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.MembershipBinding").msgclass + MembershipBindingLifecycleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.MembershipBindingLifecycleState").msgclass + MembershipBindingLifecycleState::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.MembershipBindingLifecycleState.Code").enummodule + end + end + end +end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/multiclusteringress/multiclusteringress_pb.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/multiclusteringress/multiclusteringress_pb.rb deleted file mode 100644 index 594fe9e25e34..000000000000 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/multiclusteringress/multiclusteringress_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/gkehub/v1/multiclusteringress/multiclusteringress.proto - -require 'google/protobuf' - - -descriptor_data = "\nDgoogle/cloud/gkehub/v1/multiclusteringress/multiclusteringress.proto\x12*google.cloud.gkehub.multiclusteringress.v1\"(\n\x0b\x46\x65\x61tureSpec\x12\x19\n\x11\x63onfig_membership\x18\x01 \x01(\tB\xb9\x02\n.com.google.cloud.gkehub.multiclusteringress.v1B\x18MultiClusterIngressProtoP\x01Z`cloud.google.com/go/gkehub/multiclusteringress/apiv1/multiclusteringresspb;multiclusteringresspb\xaa\x02*Google.Cloud.GkeHub.MultiClusterIngress.V1\xca\x02*Google\\Cloud\\GkeHub\\MultiClusterIngress\\V1\xea\x02.Google::Cloud::GkeHub::MultiClusterIngress::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module GkeHub - module MultiClusterIngress - module V1 - FeatureSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.multiclusteringress.v1.FeatureSpec").msgclass - end - end - end - end -end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/service_pb.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/service_pb.rb index 9582a68880e8..612cbecb8655 100644 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/service_pb.rb +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/service_pb.rb @@ -9,13 +9,14 @@ require 'google/api/field_behavior_pb' require 'google/api/resource_pb' require 'google/cloud/gkehub/v1/feature_pb' +require 'google/cloud/gkehub/v1/fleet_pb' require 'google/cloud/gkehub/v1/membership_pb' require 'google/longrunning/operations_pb' require 'google/protobuf/field_mask_pb' require 'google/protobuf/timestamp_pb' -descriptor_data = "\n$google/cloud/gkehub/v1/service.proto\x12\x16google.cloud.gkehub.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/gkehub/v1/feature.proto\x1a\'google/cloud/gkehub/v1/membership.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xaf\x01\n\x16ListMembershipsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 gkehub.googleapis.com/Membership\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"~\n\x17ListMembershipsResponse\x12\x35\n\tresources\x18\x01 \x03(\x0b\x32\".google.cloud.gkehub.v1.Membership\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"N\n\x14GetMembershipRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\"\xc3\x01\n\x17\x43reateMembershipRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 gkehub.googleapis.com/Membership\x12\x1a\n\rmembership_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x08resource\x18\x03 \x01(\x0b\x32\".google.cloud.gkehub.v1.MembershipB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"~\n\x17\x44\x65leteMembershipRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xdb\x01\n\x17UpdateMembershipRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x08resource\x18\x03 \x01(\x0b\x32\".google.cloud.gkehub.v1.MembershipB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xf2\x01\n\x1eGenerateConnectManifestRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\x12\x16\n\tnamespace\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05proxy\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nis_upgrade\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x15\n\x08registry\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12&\n\x19image_pull_secret_content\x18\x07 \x01(\x0c\x42\x03\xe0\x41\x01\"a\n\x1fGenerateConnectManifestResponse\x12>\n\x08manifest\x18\x01 \x03(\x0b\x32,.google.cloud.gkehub.v1.ConnectAgentResource\"X\n\x14\x43onnectAgentResource\x12.\n\x04type\x18\x01 \x01(\x0b\x32 .google.cloud.gkehub.v1.TypeMeta\x12\x10\n\x08manifest\x18\x02 \x01(\t\"-\n\x08TypeMeta\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x13\n\x0b\x61pi_version\x18\x02 \x01(\t\"\x92\x01\n\x13ListFeaturesRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xfa\x41\x1f\x12\x1dgkehub.googleapis.com/Feature\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"c\n\x14ListFeaturesResponse\x12\x32\n\tresources\x18\x01 \x03(\x0b\x32\x1f.google.cloud.gkehub.v1.Feature\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"E\n\x11GetFeatureRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dgkehub.googleapis.com/Feature\"\xa5\x01\n\x14\x43reateFeatureRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xfa\x41\x1f\x12\x1dgkehub.googleapis.com/Feature\x12\x12\n\nfeature_id\x18\x02 \x01(\t\x12\x31\n\x08resource\x18\x03 \x01(\x0b\x32\x1f.google.cloud.gkehub.v1.Feature\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"p\n\x14\x44\x65leteFeatureRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dgkehub.googleapis.com/Feature\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xc0\x01\n\x14UpdateFeatureRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dgkehub.googleapis.com/Feature\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x31\n\x08resource\x18\x03 \x01(\x0b\x32\x1f.google.cloud.gkehub.v1.Feature\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\xf9\x01\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rstatus_detail\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10\x63\x61ncel_requested\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xf0\x11\n\x06GkeHub\x12\xb4\x01\n\x0fListMemberships\x12..google.cloud.gkehub.v1.ListMembershipsRequest\x1a/.google.cloud.gkehub.v1.ListMembershipsResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v1/{parent=projects/*/locations/*}/memberships\x12\xa8\x01\n\x0cListFeatures\x12+.google.cloud.gkehub.v1.ListFeaturesRequest\x1a,.google.cloud.gkehub.v1.ListFeaturesResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/features\x12\xa1\x01\n\rGetMembership\x12,.google.cloud.gkehub.v1.GetMembershipRequest\x1a\".google.cloud.gkehub.v1.Membership\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/memberships/*}\x12\x95\x01\n\nGetFeature\x12).google.cloud.gkehub.v1.GetFeatureRequest\x1a\x1f.google.cloud.gkehub.v1.Feature\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/features/*}\x12\xe8\x01\n\x10\x43reateMembership\x12/.google.cloud.gkehub.v1.CreateMembershipRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x1f\n\nMembership\x12\x11OperationMetadata\xda\x41\x1dparent,resource,membership_id\x82\xd3\xe4\x93\x02;\"//v1/{parent=projects/*/locations/*}/memberships:\x08resource\x12\xd8\x01\n\rCreateFeature\x12,.google.cloud.gkehub.v1.CreateFeatureRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x1c\n\x07\x46\x65\x61ture\x12\x11OperationMetadata\xda\x41\x1aparent,resource,feature_id\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/features:\x08resource\x12\xcf\x01\n\x10\x44\x65leteMembership\x12/.google.cloud.gkehub.v1.DeleteMembershipRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v1/{name=projects/*/locations/*/memberships/*}\x12\xc6\x01\n\rDeleteFeature\x12,.google.cloud.gkehub.v1.DeleteFeatureRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/features/*}\x12\xe3\x01\n\x10UpdateMembership\x12/.google.cloud.gkehub.v1.UpdateMembershipRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1f\n\nMembership\x12\x11OperationMetadata\xda\x41\x19name,resource,update_mask\x82\xd3\xe4\x93\x02;2//v1/{name=projects/*/locations/*/memberships/*}:\x08resource\x12\xd7\x01\n\rUpdateFeature\x12,.google.cloud.gkehub.v1.UpdateFeatureRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1c\n\x07\x46\x65\x61ture\x12\x11OperationMetadata\xda\x41\x19name,resource,update_mask\x82\xd3\xe4\x93\x02\x38\x32,/v1/{name=projects/*/locations/*/features/*}:\x08resource\x12\xdb\x01\n\x17GenerateConnectManifest\x12\x36.google.cloud.gkehub.v1.GenerateConnectManifestRequest\x1a\x37.google.cloud.gkehub.v1.GenerateConnectManifestResponse\"O\x82\xd3\xe4\x93\x02I\x12G/v1/{name=projects/*/locations/*/memberships/*}:generateConnectManifest\x1aI\xca\x41\x15gkehub.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xae\x01\n\x1a\x63om.google.cloud.gkehub.v1B\x0cServiceProtoP\x01Z2cloud.google.com/go/gkehub/apiv1/gkehubpb;gkehubpb\xaa\x02\x16Google.Cloud.GkeHub.V1\xca\x02\x16Google\\Cloud\\GkeHub\\V1\xea\x02\x19Google::Cloud::GkeHub::V1b\x06proto3" +descriptor_data = "\n$google/cloud/gkehub/v1/service.proto\x12\x16google.cloud.gkehub.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/gkehub/v1/feature.proto\x1a\"google/cloud/gkehub/v1/fleet.proto\x1a\'google/cloud/gkehub/v1/membership.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Q\n\x18GetScopeNamespaceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fgkehub.googleapis.com/Namespace\"\xb8\x01\n\x1b\x43reateScopeNamespaceRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fgkehub.googleapis.com/Namespace\x12\x1f\n\x12scope_namespace_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0fscope_namespace\x18\x03 \x01(\x0b\x32!.google.cloud.gkehub.v1.NamespaceB\x03\xe0\x41\x02\"\x94\x01\n\x1bUpdateScopeNamespaceRequest\x12?\n\x0fscope_namespace\x18\x01 \x01(\x0b\x32!.google.cloud.gkehub.v1.NamespaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"T\n\x1b\x44\x65leteScopeNamespaceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fgkehub.googleapis.com/Namespace\"\x86\x01\n\x1aListScopeNamespacesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fgkehub.googleapis.com/Namespace\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"s\n\x1bListScopeNamespacesResponse\x12;\n\x10scope_namespaces\x18\x01 \x03(\x0b\x32!.google.cloud.gkehub.v1.Namespace\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x1eGetScopeRBACRoleBindingRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%gkehub.googleapis.com/RBACRoleBinding\"\xca\x01\n!CreateScopeRBACRoleBindingRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%gkehub.googleapis.com/RBACRoleBinding\x12\x1f\n\x12rbacrolebinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\x0frbacrolebinding\x18\x03 \x01(\x0b\x32\'.google.cloud.gkehub.v1.RBACRoleBindingB\x03\xe0\x41\x02\"\xa0\x01\n!UpdateScopeRBACRoleBindingRequest\x12\x45\n\x0frbacrolebinding\x18\x01 \x01(\x0b\x32\'.google.cloud.gkehub.v1.RBACRoleBindingB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"`\n!DeleteScopeRBACRoleBindingRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%gkehub.googleapis.com/RBACRoleBinding\"\x92\x01\n ListScopeRBACRoleBindingsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%gkehub.googleapis.com/RBACRoleBinding\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x7f\n!ListScopeRBACRoleBindingsResponse\x12\x41\n\x10rbacrolebindings\x18\x01 \x03(\x0b\x32\'.google.cloud.gkehub.v1.RBACRoleBinding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"D\n\x0fGetScopeRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bgkehub.googleapis.com/Scope\"\x93\x01\n\x12\x43reateScopeRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bgkehub.googleapis.com/Scope\x12\x15\n\x08scope_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x05scope\x18\x03 \x01(\x0b\x32\x1d.google.cloud.gkehub.v1.ScopeB\x03\xe0\x41\x02\"}\n\x12UpdateScopeRequest\x12\x31\n\x05scope\x18\x01 \x01(\x0b\x32\x1d.google.cloud.gkehub.v1.ScopeB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"G\n\x12\x44\x65leteScopeRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bgkehub.googleapis.com/Scope\"y\n\x11ListScopesRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bgkehub.googleapis.com/Scope\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\\\n\x12ListScopesResponse\x12-\n\x06scopes\x18\x01 \x03(\x0b\x32\x1d.google.cloud.gkehub.v1.Scope\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x82\x01\n\x1aListPermittedScopesRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bgkehub.googleapis.com/Scope\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"e\n\x1bListPermittedScopesResponse\x12-\n\x06scopes\x18\x01 \x03(\x0b\x32\x1d.google.cloud.gkehub.v1.Scope\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\\\n\x1bGetMembershipBindingRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'gkehub.googleapis.com/MembershipBinding\"\xd1\x01\n\x1e\x43reateMembershipBindingRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'gkehub.googleapis.com/MembershipBinding\x12J\n\x12membership_binding\x18\x02 \x01(\x0b\x32).google.cloud.gkehub.v1.MembershipBindingB\x03\xe0\x41\x02\x12\"\n\x15membership_binding_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xa2\x01\n\x1eUpdateMembershipBindingRequest\x12J\n\x12membership_binding\x18\x01 \x01(\x0b\x32).google.cloud.gkehub.v1.MembershipBindingB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"_\n\x1e\x44\x65leteMembershipBindingRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'gkehub.googleapis.com/MembershipBinding\"\xa6\x01\n\x1dListMembershipBindingsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'gkehub.googleapis.com/MembershipBinding\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x96\x01\n\x1eListMembershipBindingsResponse\x12\x46\n\x13membership_bindings\x18\x01 \x03(\x0b\x32).google.cloud.gkehub.v1.MembershipBinding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xaf\x01\n\x16ListMembershipsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 gkehub.googleapis.com/Membership\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"b\n#GetMembershipRBACRoleBindingRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%gkehub.googleapis.com/RBACRoleBinding\"\xcf\x01\n&CreateMembershipRBACRoleBindingRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%gkehub.googleapis.com/RBACRoleBinding\x12\x1f\n\x12rbacrolebinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\x0frbacrolebinding\x18\x03 \x01(\x0b\x32\'.google.cloud.gkehub.v1.RBACRoleBindingB\x03\xe0\x41\x02\"\xa5\x01\n&UpdateMembershipRBACRoleBindingRequest\x12\x45\n\x0frbacrolebinding\x18\x01 \x01(\x0b\x32\'.google.cloud.gkehub.v1.RBACRoleBindingB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"e\n&DeleteMembershipRBACRoleBindingRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%gkehub.googleapis.com/RBACRoleBinding\"\x97\x01\n%ListMembershipRBACRoleBindingsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%gkehub.googleapis.com/RBACRoleBinding\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x99\x01\n&ListMembershipRBACRoleBindingsResponse\x12\x41\n\x10rbacrolebindings\x18\x01 \x03(\x0b\x32\'.google.cloud.gkehub.v1.RBACRoleBinding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xd0\x01\n,GenerateMembershipRBACRoleBindingYAMLRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\x12\x1f\n\x12rbacrolebinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\x0frbacrolebinding\x18\x03 \x01(\x0b\x32\'.google.cloud.gkehub.v1.RBACRoleBindingB\x03\xe0\x41\x02\"K\n-GenerateMembershipRBACRoleBindingYAMLResponse\x12\x1a\n\x12role_bindings_yaml\x18\x01 \x01(\t\"~\n\x17ListMembershipsResponse\x12\x35\n\tresources\x18\x01 \x03(\x0b\x32\".google.cloud.gkehub.v1.Membership\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"N\n\x14GetMembershipRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\"\x9c\x01\n\x1bListBoundMembershipsRequest\x12\x37\n\nscope_name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bgkehub.googleapis.com/Scope\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x85\x01\n\x1cListBoundMembershipsResponse\x12\x37\n\x0bmemberships\x18\x01 \x03(\x0b\x32\".google.cloud.gkehub.v1.Membership\x12\x13\n\x0bunreachable\x18\x02 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\"\xc3\x01\n\x17\x43reateMembershipRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 gkehub.googleapis.com/Membership\x12\x1a\n\rmembership_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x08resource\x18\x03 \x01(\x0b\x32\".google.cloud.gkehub.v1.MembershipB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"~\n\x17\x44\x65leteMembershipRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xdb\x01\n\x17UpdateMembershipRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x08resource\x18\x03 \x01(\x0b\x32\".google.cloud.gkehub.v1.MembershipB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xf2\x01\n\x1eGenerateConnectManifestRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n gkehub.googleapis.com/Membership\x12\x16\n\tnamespace\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05proxy\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nis_upgrade\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x15\n\x08registry\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12&\n\x19image_pull_secret_content\x18\x07 \x01(\x0c\x42\x03\xe0\x41\x01\"a\n\x1fGenerateConnectManifestResponse\x12>\n\x08manifest\x18\x01 \x03(\x0b\x32,.google.cloud.gkehub.v1.ConnectAgentResource\"X\n\x14\x43onnectAgentResource\x12.\n\x04type\x18\x01 \x01(\x0b\x32 .google.cloud.gkehub.v1.TypeMeta\x12\x10\n\x08manifest\x18\x02 \x01(\t\"-\n\x08TypeMeta\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x13\n\x0b\x61pi_version\x18\x02 \x01(\t\"\xb7\x01\n\x13ListFeaturesRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xfa\x41\x1f\x12\x1dgkehub.googleapis.com/Feature\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12#\n\x16return_partial_success\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"c\n\x14ListFeaturesResponse\x12\x32\n\tresources\x18\x01 \x03(\x0b\x32\x1f.google.cloud.gkehub.v1.Feature\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"j\n\x11GetFeatureRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dgkehub.googleapis.com/Feature\x12#\n\x16return_partial_success\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xa5\x01\n\x14\x43reateFeatureRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xfa\x41\x1f\x12\x1dgkehub.googleapis.com/Feature\x12\x12\n\nfeature_id\x18\x02 \x01(\t\x12\x31\n\x08resource\x18\x03 \x01(\x0b\x32\x1f.google.cloud.gkehub.v1.Feature\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"p\n\x14\x44\x65leteFeatureRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dgkehub.googleapis.com/Feature\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xc0\x01\n\x14UpdateFeatureRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dgkehub.googleapis.com/Feature\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x31\n\x08resource\x18\x03 \x01(\x0b\x32\x1f.google.cloud.gkehub.v1.Feature\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x82\x01\n\x12\x43reateFleetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x31\n\x05\x66leet\x18\x02 \x01(\x0b\x32\x1d.google.cloud.gkehub.v1.FleetB\x03\xe0\x41\x02\"D\n\x0fGetFleetRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bgkehub.googleapis.com/Fleet\"}\n\x12UpdateFleetRequest\x12\x31\n\x05\x66leet\x18\x01 \x01(\x0b\x32\x1d.google.cloud.gkehub.v1.FleetB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"G\n\x12\x44\x65leteFleetRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bgkehub.googleapis.com/Fleet\"\x7f\n\x11ListFleetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\\\n\x12ListFleetsResponse\x12-\n\x06\x66leets\x18\x01 \x03(\x0b\x32\x1d.google.cloud.gkehub.v1.Fleet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xf9\x01\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rstatus_detail\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10\x63\x61ncel_requested\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\x96M\n\x06GkeHub\x12\xb4\x01\n\x0fListMemberships\x12..google.cloud.gkehub.v1.ListMembershipsRequest\x1a/.google.cloud.gkehub.v1.ListMembershipsResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v1/{parent=projects/*/locations/*}/memberships\x12\xd8\x01\n\x14ListBoundMemberships\x12\x33.google.cloud.gkehub.v1.ListBoundMembershipsRequest\x1a\x34.google.cloud.gkehub.v1.ListBoundMembershipsResponse\"U\xda\x41\nscope_name\x82\xd3\xe4\x93\x02\x42\x12@/v1/{scope_name=projects/*/locations/*/scopes/*}:listMemberships\x12\xa8\x01\n\x0cListFeatures\x12+.google.cloud.gkehub.v1.ListFeaturesRequest\x1a,.google.cloud.gkehub.v1.ListFeaturesResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/features\x12\xa1\x01\n\rGetMembership\x12,.google.cloud.gkehub.v1.GetMembershipRequest\x1a\".google.cloud.gkehub.v1.Membership\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/memberships/*}\x12\x95\x01\n\nGetFeature\x12).google.cloud.gkehub.v1.GetFeatureRequest\x1a\x1f.google.cloud.gkehub.v1.Feature\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/features/*}\x12\xe8\x01\n\x10\x43reateMembership\x12/.google.cloud.gkehub.v1.CreateMembershipRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x1f\n\nMembership\x12\x11OperationMetadata\xda\x41\x1dparent,resource,membership_id\x82\xd3\xe4\x93\x02;\"//v1/{parent=projects/*/locations/*}/memberships:\x08resource\x12\xd8\x01\n\rCreateFeature\x12,.google.cloud.gkehub.v1.CreateFeatureRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x1c\n\x07\x46\x65\x61ture\x12\x11OperationMetadata\xda\x41\x1aparent,resource,feature_id\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/features:\x08resource\x12\xcf\x01\n\x10\x44\x65leteMembership\x12/.google.cloud.gkehub.v1.DeleteMembershipRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v1/{name=projects/*/locations/*/memberships/*}\x12\xc6\x01\n\rDeleteFeature\x12,.google.cloud.gkehub.v1.DeleteFeatureRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/features/*}\x12\xe3\x01\n\x10UpdateMembership\x12/.google.cloud.gkehub.v1.UpdateMembershipRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1f\n\nMembership\x12\x11OperationMetadata\xda\x41\x19name,resource,update_mask\x82\xd3\xe4\x93\x02;2//v1/{name=projects/*/locations/*/memberships/*}:\x08resource\x12\xd7\x01\n\rUpdateFeature\x12,.google.cloud.gkehub.v1.UpdateFeatureRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1c\n\x07\x46\x65\x61ture\x12\x11OperationMetadata\xda\x41\x19name,resource,update_mask\x82\xd3\xe4\x93\x02\x38\x32,/v1/{name=projects/*/locations/*/features/*}:\x08resource\x12\xdb\x01\n\x17GenerateConnectManifest\x12\x36.google.cloud.gkehub.v1.GenerateConnectManifestRequest\x1a\x37.google.cloud.gkehub.v1.GenerateConnectManifestResponse\"O\x82\xd3\xe4\x93\x02I\x12G/v1/{name=projects/*/locations/*/memberships/*}:generateConnectManifest\x12\xbf\x01\n\x0b\x43reateFleet\x12*.google.cloud.gkehub.v1.CreateFleetRequest\x1a\x1d.google.longrunning.Operation\"e\xca\x41\x1a\n\x05\x46leet\x12\x11OperationMetadata\xda\x41\x0cparent,fleet\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/fleets:\x05\x66leet\x12\x8d\x01\n\x08GetFleet\x12\'.google.cloud.gkehub.v1.GetFleetRequest\x1a\x1d.google.cloud.gkehub.v1.Fleet\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/fleets/*}\x12\xca\x01\n\x0bUpdateFleet\x12*.google.cloud.gkehub.v1.UpdateFleetRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x1a\n\x05\x46leet\x12\x11OperationMetadata\xda\x41\x11\x66leet,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{fleet.name=projects/*/locations/*/fleets/*}:\x05\x66leet\x12\xc0\x01\n\x0b\x44\x65leteFleet\x12*.google.cloud.gkehub.v1.DeleteFleetRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/fleets/*}\x12\xd3\x01\n\nListFleets\x12).google.cloud.gkehub.v1.ListFleetsRequest\x1a*.google.cloud.gkehub.v1.ListFleetsResponse\"n\xda\x41\x06parent\x82\xd3\xe4\x93\x02_\x12*/v1/{parent=projects/*/locations/*}/fleetsZ1\x12//v1/{parent=organizations/*/locations/*}/fleets\x12\xb0\x01\n\x11GetScopeNamespace\x12\x30.google.cloud.gkehub.v1.GetScopeNamespaceRequest\x1a!.google.cloud.gkehub.v1.Namespace\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/locations/*/scopes/*/namespaces/*}\x12\x8a\x02\n\x14\x43reateScopeNamespace\x12\x33.google.cloud.gkehub.v1.CreateScopeNamespaceRequest\x1a\x1d.google.longrunning.Operation\"\x9d\x01\xca\x41\x1e\n\tNamespace\x12\x11OperationMetadata\xda\x41)parent,scope_namespace,scope_namespace_id\x82\xd3\xe4\x93\x02J\"7/v1/{parent=projects/*/locations/*/scopes/*}/namespaces:\x0fscope_namespace\x12\x8c\x02\n\x14UpdateScopeNamespace\x12\x33.google.cloud.gkehub.v1.UpdateScopeNamespaceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41\x1e\n\tNamespace\x12\x11OperationMetadata\xda\x41\x1bscope_namespace,update_mask\x82\xd3\xe4\x93\x02Z2G/v1/{scope_namespace.name=projects/*/locations/*/scopes/*/namespaces/*}:\x0fscope_namespace\x12\xdf\x01\n\x14\x44\x65leteScopeNamespace\x12\x33.google.cloud.gkehub.v1.DeleteScopeNamespaceRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v1/{name=projects/*/locations/*/scopes/*/namespaces/*}\x12\xc8\x01\n\x13ListScopeNamespaces\x12\x32.google.cloud.gkehub.v1.ListScopeNamespacesRequest\x1a\x33.google.cloud.gkehub.v1.ListScopeNamespacesResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*/scopes/*}/namespaces\x12\xc8\x01\n\x17GetScopeRBACRoleBinding\x12\x36.google.cloud.gkehub.v1.GetScopeRBACRoleBindingRequest\x1a\'.google.cloud.gkehub.v1.RBACRoleBinding\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/scopes/*/rbacrolebindings/*}\x12\xa2\x02\n\x1a\x43reateScopeRBACRoleBinding\x12\x39.google.cloud.gkehub.v1.CreateScopeRBACRoleBindingRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\xca\x41$\n\x0fRBACRoleBinding\x12\x11OperationMetadata\xda\x41)parent,rbacrolebinding,rbacrolebinding_id\x82\xd3\xe4\x93\x02P\"=/v1/{parent=projects/*/locations/*/scopes/*}/rbacrolebindings:\x0frbacrolebinding\x12\xa4\x02\n\x1aUpdateScopeRBACRoleBinding\x12\x39.google.cloud.gkehub.v1.UpdateScopeRBACRoleBindingRequest\x1a\x1d.google.longrunning.Operation\"\xab\x01\xca\x41$\n\x0fRBACRoleBinding\x12\x11OperationMetadata\xda\x41\x1brbacrolebinding,update_mask\x82\xd3\xe4\x93\x02`2M/v1/{rbacrolebinding.name=projects/*/locations/*/scopes/*/rbacrolebindings/*}:\x0frbacrolebinding\x12\xf1\x01\n\x1a\x44\x65leteScopeRBACRoleBinding\x12\x39.google.cloud.gkehub.v1.DeleteScopeRBACRoleBindingRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v1/{name=projects/*/locations/*/scopes/*/rbacrolebindings/*}\x12\xe0\x01\n\x19ListScopeRBACRoleBindings\x12\x38.google.cloud.gkehub.v1.ListScopeRBACRoleBindingsRequest\x1a\x39.google.cloud.gkehub.v1.ListScopeRBACRoleBindingsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/scopes/*}/rbacrolebindings\x12\x8d\x01\n\x08GetScope\x12\'.google.cloud.gkehub.v1.GetScopeRequest\x1a\x1d.google.cloud.gkehub.v1.Scope\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/scopes/*}\x12\xc8\x01\n\x0b\x43reateScope\x12*.google.cloud.gkehub.v1.CreateScopeRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1a\n\x05Scope\x12\x11OperationMetadata\xda\x41\x15parent,scope,scope_id\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/scopes:\x05scope\x12\xca\x01\n\x0bUpdateScope\x12*.google.cloud.gkehub.v1.UpdateScopeRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x1a\n\x05Scope\x12\x11OperationMetadata\xda\x41\x11scope,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{scope.name=projects/*/locations/*/scopes/*}:\x05scope\x12\xc0\x01\n\x0b\x44\x65leteScope\x12*.google.cloud.gkehub.v1.DeleteScopeRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/scopes/*}\x12\xa0\x01\n\nListScopes\x12).google.cloud.gkehub.v1.ListScopesRequest\x1a*.google.cloud.gkehub.v1.ListScopesResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/scopes\x12\xc9\x01\n\x13ListPermittedScopes\x12\x32.google.cloud.gkehub.v1.ListPermittedScopesRequest\x1a\x33.google.cloud.gkehub.v1.ListPermittedScopesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}/scopes:listPermitted\x12\xc1\x01\n\x14GetMembershipBinding\x12\x33.google.cloud.gkehub.v1.GetMembershipBindingRequest\x1a).google.cloud.gkehub.v1.MembershipBinding\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=projects/*/locations/*/memberships/*/bindings/*}\x12\xa4\x02\n\x17\x43reateMembershipBinding\x12\x36.google.cloud.gkehub.v1.CreateMembershipBindingRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41&\n\x11MembershipBinding\x12\x11OperationMetadata\xda\x41/parent,membership_binding,membership_binding_id\x82\xd3\xe4\x93\x02P\":/v1/{parent=projects/*/locations/*/memberships/*}/bindings:\x12membership_binding\x12\xa6\x02\n\x17UpdateMembershipBinding\x12\x36.google.cloud.gkehub.v1.UpdateMembershipBindingRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\xca\x41&\n\x11MembershipBinding\x12\x11OperationMetadata\xda\x41\x1emembership_binding,update_mask\x82\xd3\xe4\x93\x02\x63\x32M/v1/{membership_binding.name=projects/*/locations/*/memberships/*/bindings/*}:\x12membership_binding\x12\xe8\x01\n\x17\x44\x65leteMembershipBinding\x12\x36.google.cloud.gkehub.v1.DeleteMembershipBindingRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<*:/v1/{name=projects/*/locations/*/memberships/*/bindings/*}\x12\xd4\x01\n\x16ListMembershipBindings\x12\x35.google.cloud.gkehub.v1.ListMembershipBindingsRequest\x1a\x36.google.cloud.gkehub.v1.ListMembershipBindingsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/locations/*/memberships/*}/bindings\x12\xd7\x01\n\x1cGetMembershipRBACRoleBinding\x12;.google.cloud.gkehub.v1.GetMembershipRBACRoleBindingRequest\x1a\'.google.cloud.gkehub.v1.RBACRoleBinding\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{name=projects/*/locations/*/memberships/*/rbacrolebindings/*}\x12\xb1\x02\n\x1f\x43reateMembershipRBACRoleBinding\x12>.google.cloud.gkehub.v1.CreateMembershipRBACRoleBindingRequest\x1a\x1d.google.longrunning.Operation\"\xae\x01\xca\x41$\n\x0fRBACRoleBinding\x12\x11OperationMetadata\xda\x41)parent,rbacrolebinding,rbacrolebinding_id\x82\xd3\xe4\x93\x02U\"B/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings:\x0frbacrolebinding\x12\xb3\x02\n\x1fUpdateMembershipRBACRoleBinding\x12>.google.cloud.gkehub.v1.UpdateMembershipRBACRoleBindingRequest\x1a\x1d.google.longrunning.Operation\"\xb0\x01\xca\x41$\n\x0fRBACRoleBinding\x12\x11OperationMetadata\xda\x41\x1brbacrolebinding,update_mask\x82\xd3\xe4\x93\x02\x65\x32R/v1/{rbacrolebinding.name=projects/*/locations/*/memberships/*/rbacrolebindings/*}:\x0frbacrolebinding\x12\x80\x02\n\x1f\x44\x65leteMembershipRBACRoleBinding\x12>.google.cloud.gkehub.v1.DeleteMembershipRBACRoleBindingRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44*B/v1/{name=projects/*/locations/*/memberships/*/rbacrolebindings/*}\x12\xf4\x01\n\x1eListMembershipRBACRoleBindings\x12=.google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsRequest\x1a>.google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings\x12\xb8\x02\n%GenerateMembershipRBACRoleBindingYAML\x12\x44.google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLRequest\x1a\x45.google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLResponse\"\x81\x01\x82\xd3\xe4\x93\x02{\"h/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings:generateMembershipRBACRoleBindingYAML:\x0frbacrolebinding\x1aI\xca\x41\x15gkehub.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xae\x01\n\x1a\x63om.google.cloud.gkehub.v1B\x0cServiceProtoP\x01Z2cloud.google.com/go/gkehub/apiv1/gkehubpb;gkehubpb\xaa\x02\x16Google.Cloud.GkeHub.V1\xca\x02\x16Google\\Cloud\\GkeHub\\V1\xea\x02\x19Google::Cloud::GkeHub::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -30,8 +31,9 @@ file = pool.add_serialized_file(serialized) warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" imports = [ - ["google.cloud.gkehub.v1.Membership", "google/cloud/gkehub/v1/membership.proto"], + ["google.cloud.gkehub.v1.Namespace", "google/cloud/gkehub/v1/fleet.proto"], ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.gkehub.v1.Membership", "google/cloud/gkehub/v1/membership.proto"], ["google.cloud.gkehub.v1.Feature", "google/cloud/gkehub/v1/feature.proto"], ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], ] @@ -49,9 +51,45 @@ module Google module Cloud module GkeHub module V1 + GetScopeNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GetScopeNamespaceRequest").msgclass + CreateScopeNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CreateScopeNamespaceRequest").msgclass + UpdateScopeNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.UpdateScopeNamespaceRequest").msgclass + DeleteScopeNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DeleteScopeNamespaceRequest").msgclass + ListScopeNamespacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListScopeNamespacesRequest").msgclass + ListScopeNamespacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListScopeNamespacesResponse").msgclass + GetScopeRBACRoleBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GetScopeRBACRoleBindingRequest").msgclass + CreateScopeRBACRoleBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CreateScopeRBACRoleBindingRequest").msgclass + UpdateScopeRBACRoleBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.UpdateScopeRBACRoleBindingRequest").msgclass + DeleteScopeRBACRoleBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DeleteScopeRBACRoleBindingRequest").msgclass + ListScopeRBACRoleBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListScopeRBACRoleBindingsRequest").msgclass + ListScopeRBACRoleBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListScopeRBACRoleBindingsResponse").msgclass + GetScopeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GetScopeRequest").msgclass + CreateScopeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CreateScopeRequest").msgclass + UpdateScopeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.UpdateScopeRequest").msgclass + DeleteScopeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DeleteScopeRequest").msgclass + ListScopesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListScopesRequest").msgclass + ListScopesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListScopesResponse").msgclass + ListPermittedScopesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListPermittedScopesRequest").msgclass + ListPermittedScopesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListPermittedScopesResponse").msgclass + GetMembershipBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GetMembershipBindingRequest").msgclass + CreateMembershipBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CreateMembershipBindingRequest").msgclass + UpdateMembershipBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.UpdateMembershipBindingRequest").msgclass + DeleteMembershipBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DeleteMembershipBindingRequest").msgclass + ListMembershipBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListMembershipBindingsRequest").msgclass + ListMembershipBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListMembershipBindingsResponse").msgclass ListMembershipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListMembershipsRequest").msgclass + GetMembershipRBACRoleBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GetMembershipRBACRoleBindingRequest").msgclass + CreateMembershipRBACRoleBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CreateMembershipRBACRoleBindingRequest").msgclass + UpdateMembershipRBACRoleBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.UpdateMembershipRBACRoleBindingRequest").msgclass + DeleteMembershipRBACRoleBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DeleteMembershipRBACRoleBindingRequest").msgclass + ListMembershipRBACRoleBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsRequest").msgclass + ListMembershipRBACRoleBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsResponse").msgclass + GenerateMembershipRBACRoleBindingYAMLRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLRequest").msgclass + GenerateMembershipRBACRoleBindingYAMLResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLResponse").msgclass ListMembershipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListMembershipsResponse").msgclass GetMembershipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GetMembershipRequest").msgclass + ListBoundMembershipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListBoundMembershipsRequest").msgclass + ListBoundMembershipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListBoundMembershipsResponse").msgclass CreateMembershipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CreateMembershipRequest").msgclass DeleteMembershipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DeleteMembershipRequest").msgclass UpdateMembershipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.UpdateMembershipRequest").msgclass @@ -65,6 +103,12 @@ module V1 CreateFeatureRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CreateFeatureRequest").msgclass DeleteFeatureRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DeleteFeatureRequest").msgclass UpdateFeatureRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.UpdateFeatureRequest").msgclass + CreateFleetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.CreateFleetRequest").msgclass + GetFleetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.GetFleetRequest").msgclass + UpdateFleetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.UpdateFleetRequest").msgclass + DeleteFleetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.DeleteFleetRequest").msgclass + ListFleetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListFleetsRequest").msgclass + ListFleetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.ListFleetsResponse").msgclass OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.gkehub.v1.OperationMetadata").msgclass end end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/service_services_pb.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/service_services_pb.rb index 2fe15a13a3a8..996c50e5b42a 100644 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/service_services_pb.rb +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gkehub/v1/service_services_pb.rb @@ -51,6 +51,9 @@ class Service # Lists Memberships in a given project and location. rpc :ListMemberships, ::Google::Cloud::GkeHub::V1::ListMembershipsRequest, ::Google::Cloud::GkeHub::V1::ListMembershipsResponse + # Lists Memberships bound to a Scope. The response includes relevant + # Memberships from all regions. + rpc :ListBoundMemberships, ::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest, ::Google::Cloud::GkeHub::V1::ListBoundMembershipsResponse # Lists Features in a given project and location. rpc :ListFeatures, ::Google::Cloud::GkeHub::V1::ListFeaturesRequest, ::Google::Cloud::GkeHub::V1::ListFeaturesResponse # Gets the details of a Membership. @@ -82,6 +85,72 @@ class Service # **This method is used internally by Google-provided libraries.** # Most clients should not need to call this method directly. rpc :GenerateConnectManifest, ::Google::Cloud::GkeHub::V1::GenerateConnectManifestRequest, ::Google::Cloud::GkeHub::V1::GenerateConnectManifestResponse + # Creates a fleet. + rpc :CreateFleet, ::Google::Cloud::GkeHub::V1::CreateFleetRequest, ::Google::Longrunning::Operation + # Returns the details of a fleet. + rpc :GetFleet, ::Google::Cloud::GkeHub::V1::GetFleetRequest, ::Google::Cloud::GkeHub::V1::Fleet + # Updates a fleet. + rpc :UpdateFleet, ::Google::Cloud::GkeHub::V1::UpdateFleetRequest, ::Google::Longrunning::Operation + # Removes a Fleet. There must be no memberships remaining in the Fleet. + rpc :DeleteFleet, ::Google::Cloud::GkeHub::V1::DeleteFleetRequest, ::Google::Longrunning::Operation + # Returns all fleets within an organization or a project that the caller has + # access to. + rpc :ListFleets, ::Google::Cloud::GkeHub::V1::ListFleetsRequest, ::Google::Cloud::GkeHub::V1::ListFleetsResponse + # Returns the details of a fleet namespace. + rpc :GetScopeNamespace, ::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest, ::Google::Cloud::GkeHub::V1::Namespace + # Creates a fleet namespace. + rpc :CreateScopeNamespace, ::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest, ::Google::Longrunning::Operation + # Updates a fleet namespace. + rpc :UpdateScopeNamespace, ::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest, ::Google::Longrunning::Operation + # Deletes a fleet namespace. + rpc :DeleteScopeNamespace, ::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest, ::Google::Longrunning::Operation + # Lists fleet namespaces. + rpc :ListScopeNamespaces, ::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest, ::Google::Cloud::GkeHub::V1::ListScopeNamespacesResponse + # Returns the details of a Scope RBACRoleBinding. + rpc :GetScopeRBACRoleBinding, ::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest, ::Google::Cloud::GkeHub::V1::RBACRoleBinding + # Creates a Scope RBACRoleBinding. + rpc :CreateScopeRBACRoleBinding, ::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest, ::Google::Longrunning::Operation + # Updates a Scope RBACRoleBinding. + rpc :UpdateScopeRBACRoleBinding, ::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest, ::Google::Longrunning::Operation + # Deletes a Scope RBACRoleBinding. + rpc :DeleteScopeRBACRoleBinding, ::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest, ::Google::Longrunning::Operation + # Lists all Scope RBACRoleBindings. + rpc :ListScopeRBACRoleBindings, ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest, ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsResponse + # Returns the details of a Scope. + rpc :GetScope, ::Google::Cloud::GkeHub::V1::GetScopeRequest, ::Google::Cloud::GkeHub::V1::Scope + # Creates a Scope. + rpc :CreateScope, ::Google::Cloud::GkeHub::V1::CreateScopeRequest, ::Google::Longrunning::Operation + # Updates a scopes. + rpc :UpdateScope, ::Google::Cloud::GkeHub::V1::UpdateScopeRequest, ::Google::Longrunning::Operation + # Deletes a Scope. + rpc :DeleteScope, ::Google::Cloud::GkeHub::V1::DeleteScopeRequest, ::Google::Longrunning::Operation + # Lists Scopes. + rpc :ListScopes, ::Google::Cloud::GkeHub::V1::ListScopesRequest, ::Google::Cloud::GkeHub::V1::ListScopesResponse + # Lists permitted Scopes. + rpc :ListPermittedScopes, ::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest, ::Google::Cloud::GkeHub::V1::ListPermittedScopesResponse + # Returns the details of a MembershipBinding. + rpc :GetMembershipBinding, ::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest, ::Google::Cloud::GkeHub::V1::MembershipBinding + # Creates a MembershipBinding. + rpc :CreateMembershipBinding, ::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest, ::Google::Longrunning::Operation + # Updates a MembershipBinding. + rpc :UpdateMembershipBinding, ::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest, ::Google::Longrunning::Operation + # Deletes a MembershipBinding. + rpc :DeleteMembershipBinding, ::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest, ::Google::Longrunning::Operation + # Lists MembershipBindings. + rpc :ListMembershipBindings, ::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest, ::Google::Cloud::GkeHub::V1::ListMembershipBindingsResponse + # Returns the details of a Membership RBACRoleBinding. + rpc :GetMembershipRBACRoleBinding, ::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest, ::Google::Cloud::GkeHub::V1::RBACRoleBinding + # Creates a Membership RBACRoleBinding. + rpc :CreateMembershipRBACRoleBinding, ::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest, ::Google::Longrunning::Operation + # Updates a Membership RBACRoleBinding. + rpc :UpdateMembershipRBACRoleBinding, ::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest, ::Google::Longrunning::Operation + # Deletes a Membership RBACRoleBinding. + rpc :DeleteMembershipRBACRoleBinding, ::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest, ::Google::Longrunning::Operation + # Lists all Membership RBACRoleBindings. + rpc :ListMembershipRBACRoleBindings, ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest, ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsResponse + # Generates a YAML of the RBAC policies for the specified + # RoleBinding and its associated impersonation resources. + rpc :GenerateMembershipRBACRoleBindingYAML, ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest, ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse end Stub = Service.rpc_stub_class diff --git a/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/feature.rb b/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/feature.rb index e4a3423dd037..0040a908cfd4 100644 --- a/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/feature.rb +++ b/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/feature.rb @@ -21,29 +21,30 @@ module Google module Cloud module GkeHub module V1 - # Feature represents the settings and status of any Hub Feature. + # Feature represents the settings and status of any Fleet Feature. # @!attribute [r] name # @return [::String] # Output only. The full, unique name of this Feature resource in the format # `projects/*/locations/*/features/*`. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] - # GCP labels for this Feature. + # Labels for this Feature. # @!attribute [r] resource_state # @return [::Google::Cloud::GkeHub::V1::FeatureResourceState] # Output only. State of the Feature resource itself. # @!attribute [rw] spec # @return [::Google::Cloud::GkeHub::V1::CommonFeatureSpec] - # Optional. Hub-wide Feature configuration. If this Feature does not support any - # Hub-wide configuration, this field may be unused. + # Optional. Fleet-wide Feature configuration. If this Feature does not + # support any Fleet-wide configuration, this field may be unused. # @!attribute [rw] membership_specs # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::GkeHub::V1::MembershipFeatureSpec}] - # Optional. Membership-specific configuration for this Feature. If this Feature does - # not support any per-Membership configuration, this field may be unused. + # Optional. Membership-specific configuration for this Feature. If this + # Feature does not support any per-Membership configuration, this field may + # be unused. # # The keys indicate which Membership the configuration is for, in the form: # - # projects/{p}/locations/{l}/memberships/{m} + # `projects/{p}/locations/{l}/memberships/{m}` # # Where \\{p} is the project, \\{l} is a valid location and \\{m} is a valid # Membership in this project at that location. \\{p} WILL match the Feature's @@ -57,7 +58,7 @@ module V1 # mutating a Feature. # @!attribute [r] state # @return [::Google::Cloud::GkeHub::V1::CommonFeatureState] - # Output only. The Hub-wide Feature state. + # Output only. The Fleet-wide Feature state. # @!attribute [r] membership_states # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::GkeHub::V1::MembershipFeatureState}] # Output only. Membership-specific Feature status. If this Feature does @@ -65,7 +66,7 @@ module V1 # # The keys indicate which Membership the state is for, in the form: # - # projects/{p}/locations/{l}/memberships/{m} + # `projects/{p}/locations/{l}/memberships/{m}` # # Where \\{p} is the project number, \\{l} is a valid location and \\{m} is a valid # Membership in this project at that location. \\{p} MUST match the Feature's @@ -79,6 +80,39 @@ module V1 # @!attribute [r] delete_time # @return [::Google::Protobuf::Timestamp] # Output only. When the Feature resource was deleted. + # @!attribute [rw] scope_specs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::GkeHub::V1::ScopeFeatureSpec}] + # Optional. Scope-specific configuration for this Feature. If this Feature + # does not support any per-Scope configuration, this field may be unused. + # + # The keys indicate which Scope the configuration is for, in the form: + # + # `projects/{p}/locations/global/scopes/{s}` + # + # Where \\{p} is the project, \\{s} is a valid Scope in this project. + # \\{p} WILL match the Feature's project. + # + # \\{p} will always be returned as the project number, but the project ID is + # also accepted during input. If the same Scope is specified in the map + # twice (using the project ID form, and the project number form), exactly + # ONE of the entries will be saved, with no guarantees as to which. For this + # reason, it is recommended the same format be used for all entries when + # mutating a Feature. + # @!attribute [r] scope_states + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::GkeHub::V1::ScopeFeatureState}] + # Output only. Scope-specific Feature status. If this Feature does + # report any per-Scope status, this field may be unused. + # + # The keys indicate which Scope the state is for, in the form: + # + # `projects/{p}/locations/global/scopes/{s}` + # + # Where \\{p} is the project, \\{s} is a valid Scope in this project. + # \\{p} WILL match the Feature's project. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. List of locations that could not be reached while fetching + # this feature. class Feature include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -109,11 +143,29 @@ class MembershipStatesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::GkeHub::V1::ScopeFeatureSpec] + class ScopeSpecsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::GkeHub::V1::ScopeFeatureState] + class ScopeStatesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end # FeatureResourceState describes the state of a Feature *resource* in the # GkeHub API. See `FeatureState` for the "running state" of the Feature in the - # Hub and across Memberships. + # Fleet and across Memberships. # @!attribute [rw] state # @return [::Google::Cloud::GkeHub::V1::FeatureResourceState::State] # The current state of the Feature resource in the Hub API. @@ -127,14 +179,14 @@ module State STATE_UNSPECIFIED = 0 # The Feature is being enabled, and the Feature resource is being created. - # Once complete, the corresponding Feature will be enabled in this Hub. + # Once complete, the corresponding Feature will be enabled in this Fleet. ENABLING = 1 - # The Feature is enabled in this Hub, and the Feature resource is fully + # The Feature is enabled in this Fleet, and the Feature resource is fully # available. ACTIVE = 2 - # The Feature is being disabled in this Hub, and the Feature resource + # The Feature is being disabled in this Fleet, and the Feature resource # is being deleted. DISABLING = 3 @@ -193,15 +245,33 @@ class CommonFeatureSpec extend ::Google::Protobuf::MessageExts::ClassMethods end - # CommonFeatureState contains Hub-wide Feature status information. + # CommonFeatureState contains Fleet-wide Feature status information. + # @!attribute [rw] rbacrolebindingactuation + # @return [::Google::Cloud::GkeHub::RbacRoleBindingActuation::V1::FeatureState] + # RBAC Role Binding Actuation feature state # @!attribute [r] state # @return [::Google::Cloud::GkeHub::V1::FeatureState] - # Output only. The "running state" of the Feature in this Hub. + # Output only. The "running state" of the Feature in this Fleet. class CommonFeatureState include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + # ScopeFeatureSpec contains feature specs for a fleet scope. + class ScopeFeatureSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ScopeFeatureState contains Scope-wide Feature status information. + # @!attribute [r] state + # @return [::Google::Cloud::GkeHub::V1::FeatureState] + # Output only. The "running state" of the Feature in this Scope. + class ScopeFeatureState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # MembershipFeatureSpec contains configuration information for a single # Membership. # @!attribute [rw] configmanagement diff --git a/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/fleet.rb b/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/fleet.rb new file mode 100644 index 000000000000..f759b5b24428 --- /dev/null +++ b/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/fleet.rb @@ -0,0 +1,591 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module GkeHub + module V1 + # Fleet contains the Fleet-wide metadata and configuration. + # @!attribute [r] name + # @return [::String] + # Output only. The full, unique resource name of this fleet in the format of + # `projects/{project}/locations/{location}/fleets/{fleet}`. + # + # Each Google Cloud project can have at most one fleet resource, named + # "default". + # @!attribute [rw] display_name + # @return [::String] + # Optional. A user-assigned display name of the Fleet. + # When present, it must be between 4 to 30 characters. + # Allowed characters are: lowercase and uppercase letters, numbers, + # hyphen, single-quote, double-quote, space, and exclamation point. + # + # Example: `Production Fleet` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the Fleet was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the Fleet was last updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the Fleet was deleted. + # @!attribute [r] uid + # @return [::String] + # Output only. Google-generated UUID for this resource. This is unique across + # all Fleet resources. If a Fleet resource is deleted and another resource + # with the same name is created, it gets a different uid. + # @!attribute [r] state + # @return [::Google::Cloud::GkeHub::V1::FleetLifecycleState] + # Output only. State of the namespace resource. + # @!attribute [rw] default_cluster_config + # @return [::Google::Cloud::GkeHub::V1::DefaultClusterConfig] + # Optional. The default cluster configurations to apply across the fleet. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels for this Fleet. + class Fleet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # DefaultClusterConfig describes the default cluster configurations to be + # applied to all clusters born-in-fleet. + # @!attribute [rw] security_posture_config + # @return [::Google::Cloud::GkeHub::V1::SecurityPostureConfig] + # Enable/Disable Security Posture features for the cluster. + # @!attribute [rw] binary_authorization_config + # @return [::Google::Cloud::GkeHub::V1::BinaryAuthorizationConfig] + # Optional. Enable/Disable binary authorization features for the cluster. + # @!attribute [rw] compliance_posture_config + # @return [::Google::Cloud::GkeHub::V1::CompliancePostureConfig] + # Optional. Enable/Disable Compliance Posture features for the cluster. + # Note that on UpdateFleet, only full replacement of this field is allowed. + # Users are not allowed for partial updates through field mask. + class DefaultClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # SecurityPostureConfig defines the flags needed to enable/disable features for + # the Security Posture API. + # @!attribute [rw] mode + # @return [::Google::Cloud::GkeHub::V1::SecurityPostureConfig::Mode] + # Sets which mode to use for Security Posture features. + # @!attribute [rw] vulnerability_mode + # @return [::Google::Cloud::GkeHub::V1::SecurityPostureConfig::VulnerabilityMode] + # Sets which mode to use for vulnerability scanning. + class SecurityPostureConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Mode defines enablement mode for GKE Security posture features. + module Mode + # Default value not specified. + MODE_UNSPECIFIED = 0 + + # Disables Security Posture features on the cluster. + DISABLED = 1 + + # Applies Security Posture features on the cluster. + BASIC = 2 + + # Applies the Security Posture off cluster Enterprise level features. + ENTERPRISE = 3 + end + + # VulnerabilityMode defines enablement mode for vulnerability scanning. + module VulnerabilityMode + # Default value not specified. + VULNERABILITY_MODE_UNSPECIFIED = 0 + + # Disables vulnerability scanning on the cluster. + VULNERABILITY_DISABLED = 1 + + # Applies basic vulnerability scanning on the cluster. + VULNERABILITY_BASIC = 2 + + # Applies the Security Posture's vulnerability on cluster Enterprise level + # features. + VULNERABILITY_ENTERPRISE = 3 + end + end + + # BinaryAuthorizationConfig defines the fleet level configuration of binary + # authorization feature. + # @!attribute [rw] evaluation_mode + # @return [::Google::Cloud::GkeHub::V1::BinaryAuthorizationConfig::EvaluationMode] + # Optional. Mode of operation for binauthz policy evaluation. + # @!attribute [rw] policy_bindings + # @return [::Array<::Google::Cloud::GkeHub::V1::BinaryAuthorizationConfig::PolicyBinding>] + # Optional. Binauthz policies that apply to this cluster. + class BinaryAuthorizationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Binauthz policy that applies to this cluster. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of the binauthz platform policy to audit. GKE + # platform policies have the following format: + # `projects/{project_number}/platforms/gke/policies/{policy_id}`. + class PolicyBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Binary Authorization mode of operation. + module EvaluationMode + # Default value + EVALUATION_MODE_UNSPECIFIED = 0 + + # Disable BinaryAuthorization + DISABLED = 1 + + # Use Binary Authorization with the policies specified in policy_bindings. + POLICY_BINDINGS = 2 + end + end + + # CompliancePostureConfig defines the settings needed to enable/disable + # features for the Compliance Posture. + # @!attribute [rw] mode + # @return [::Google::Cloud::GkeHub::V1::CompliancePostureConfig::Mode] + # Defines the enablement mode for Compliance Posture. + # @!attribute [rw] compliance_standards + # @return [::Array<::Google::Cloud::GkeHub::V1::CompliancePostureConfig::ComplianceStandard>] + # List of enabled compliance standards. + class CompliancePostureConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] standard + # @return [::String] + # Name of the compliance standard. + class ComplianceStandard + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + module Mode + # Default value not specified. + MODE_UNSPECIFIED = 0 + + # Disables Compliance Posture features on the cluster. + DISABLED = 1 + + # Enables Compliance Posture features on the cluster. + ENABLED = 2 + end + end + + # FleetLifecycleState describes the state of a Fleet resource. + # @!attribute [r] code + # @return [::Google::Cloud::GkeHub::V1::FleetLifecycleState::Code] + # Output only. The current state of the Fleet resource. + class FleetLifecycleState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Code describes the state of a Fleet resource. + module Code + # The code is not set. + CODE_UNSPECIFIED = 0 + + # The fleet is being created. + CREATING = 1 + + # The fleet active. + READY = 2 + + # The fleet is being deleted. + DELETING = 3 + + # The fleet is being updated. + UPDATING = 4 + end + end + + # Namespace represents a namespace across the Fleet + # @!attribute [rw] name + # @return [::String] + # The resource name for the namespace + # `projects/{project}/locations/{location}/namespaces/{namespace}` + # @!attribute [r] uid + # @return [::String] + # Output only. Google-generated UUID for this resource. This is unique across + # all namespace resources. If a namespace resource is deleted and another + # resource with the same name is created, it gets a different uid. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the namespace was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the namespace was last updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the namespace was deleted. + # @!attribute [r] state + # @return [::Google::Cloud::GkeHub::V1::NamespaceLifecycleState] + # Output only. State of the namespace resource. + # @!attribute [rw] scope + # @return [::String] + # Required. Scope associated with the namespace + # @!attribute [rw] namespace_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Namespace-level cluster namespace labels. These labels are + # applied to the related namespace of the member clusters bound to the parent + # Scope. Scope-level labels (`namespace_labels` in the Fleet Scope + # resource) take precedence over Namespace-level labels if they share + # a key. Keys and values must be Kubernetes-conformant. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels for this Namespace. + class Namespace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class NamespaceLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # NamespaceLifecycleState describes the state of a Namespace resource. + # @!attribute [r] code + # @return [::Google::Cloud::GkeHub::V1::NamespaceLifecycleState::Code] + # Output only. The current state of the Namespace resource. + class NamespaceLifecycleState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Code describes the state of a Namespace resource. + module Code + # The code is not set. + CODE_UNSPECIFIED = 0 + + # The namespace is being created. + CREATING = 1 + + # The namespace active. + READY = 2 + + # The namespace is being deleted. + DELETING = 3 + + # The namespace is being updated. + UPDATING = 4 + end + end + + # RBACRoleBinding represents a rbacrolebinding across the Fleet + # @!attribute [rw] user + # @return [::String] + # user is the name of the user as seen by the kubernetes cluster, example + # "alice" or "alice@domain.tld" + # + # Note: The following fields are mutually exclusive: `user`, `group`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] group + # @return [::String] + # group is the group, as seen by the kubernetes cluster. + # + # Note: The following fields are mutually exclusive: `group`, `user`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # The resource name for the rbacrolebinding + # `projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}` + # or + # `projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding}` + # @!attribute [r] uid + # @return [::String] + # Output only. Google-generated UUID for this resource. This is unique across + # all rbacrolebinding resources. If a rbacrolebinding resource is deleted and + # another resource with the same name is created, it gets a different uid. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the rbacrolebinding was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the rbacrolebinding was last updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the rbacrolebinding was deleted. + # @!attribute [r] state + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBindingLifecycleState] + # Output only. State of the rbacrolebinding resource. + # @!attribute [rw] role + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding::Role] + # Required. Role to bind to the principal + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels for this RBACRolebinding. + class RBACRoleBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Role is the type for Kubernetes roles + # @!attribute [rw] predefined_role + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding::Role::PredefinedRoles] + # predefined_role is the Kubernetes default role to use + # @!attribute [rw] custom_role + # @return [::String] + # Optional. custom_role is the name of a custom KubernetesClusterRole to + # use. + class Role + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # PredefinedRoles is an ENUM representation of the default Kubernetes Roles + module PredefinedRoles + # UNKNOWN + UNKNOWN = 0 + + # ADMIN has EDIT and RBAC permissions + ADMIN = 1 + + # EDIT can edit all resources except RBAC + EDIT = 2 + + # VIEW can only read resources + VIEW = 3 + + # ANTHOS_SUPPORT gives Google Support read-only access to a number of + # cluster resources. + ANTHOS_SUPPORT = 4 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # RBACRoleBindingLifecycleState describes the state of a RbacRoleBinding + # resource. + # @!attribute [r] code + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBindingLifecycleState::Code] + # Output only. The current state of the rbacrolebinding resource. + class RBACRoleBindingLifecycleState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Code describes the state of a rbacrolebinding resource. + module Code + # The code is not set. + CODE_UNSPECIFIED = 0 + + # The rbacrolebinding is being created. + CREATING = 1 + + # The rbacrolebinding active. + READY = 2 + + # The rbacrolebinding is being deleted. + DELETING = 3 + + # The rbacrolebinding is being updated. + UPDATING = 4 + end + end + + # Scope represents a Scope in a Fleet. + # @!attribute [rw] name + # @return [::String] + # The resource name for the scope + # `projects/{project}/locations/{location}/scopes/{scope}` + # @!attribute [r] uid + # @return [::String] + # Output only. Google-generated UUID for this resource. This is unique across + # all scope resources. If a scope resource is deleted and another resource + # with the same name is created, it gets a different uid. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the scope was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the scope was last updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the scope was deleted. + # @!attribute [r] state + # @return [::Google::Cloud::GkeHub::V1::ScopeLifecycleState] + # Output only. State of the scope resource. + # @!attribute [rw] namespace_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Scope-level cluster namespace labels. For the member clusters + # bound to the Scope, these labels are applied to each namespace under the + # Scope. Scope-level labels take precedence over Namespace-level + # labels (`namespace_labels` in the Fleet Namespace resource) if they + # share a key. Keys and values must be Kubernetes-conformant. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels for this Scope. + class Scope + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class NamespaceLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # ScopeLifecycleState describes the state of a Scope resource. + # @!attribute [r] code + # @return [::Google::Cloud::GkeHub::V1::ScopeLifecycleState::Code] + # Output only. The current state of the scope resource. + class ScopeLifecycleState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Code describes the state of a Scope resource. + module Code + # The code is not set. + CODE_UNSPECIFIED = 0 + + # The scope is being created. + CREATING = 1 + + # The scope active. + READY = 2 + + # The scope is being deleted. + DELETING = 3 + + # The scope is being updated. + UPDATING = 4 + end + end + + # MembershipBinding is a subresource of a Membership, representing + # what Fleet Scopes (or other, future Fleet resources) a Membership is bound + # to. + # @!attribute [rw] scope + # @return [::String] + # A Scope resource name in the format + # `projects/*/locations/*/scopes/*`. + # @!attribute [rw] name + # @return [::String] + # The resource name for the membershipbinding itself + # `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}` + # @!attribute [r] uid + # @return [::String] + # Output only. Google-generated UUID for this resource. This is unique across + # all membershipbinding resources. If a membershipbinding resource is deleted + # and another resource with the same name is created, it gets a different + # uid. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the membership binding was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the membership binding was last updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the membership binding was deleted. + # @!attribute [r] state + # @return [::Google::Cloud::GkeHub::V1::MembershipBindingLifecycleState] + # Output only. State of the membership binding resource. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels for this MembershipBinding. + class MembershipBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # MembershipBindingLifecycleState describes the state of a Binding resource. + # @!attribute [r] code + # @return [::Google::Cloud::GkeHub::V1::MembershipBindingLifecycleState::Code] + # Output only. The current state of the MembershipBinding resource. + class MembershipBindingLifecycleState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Code describes the state of a MembershipBinding resource. + module Code + # The code is not set. + CODE_UNSPECIFIED = 0 + + # The membershipbinding is being created. + CREATING = 1 + + # The membershipbinding active. + READY = 2 + + # The membershipbinding is being deleted. + DELETING = 3 + + # The membershipbinding is being updated. + UPDATING = 4 + end + end + end + end + end +end diff --git a/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/rbacrolebindingactuation/rbacrolebindingactuation.rb b/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/rbacrolebindingactuation/rbacrolebindingactuation.rb new file mode 100644 index 000000000000..41386f176f58 --- /dev/null +++ b/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/rbacrolebindingactuation/rbacrolebindingactuation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module GkeHub + module RbacRoleBindingActuation + module V1 + # **RBAC RoleBinding Actuation**: The Hub-wide input for the + # RBACRoleBindingActuation feature. + # @!attribute [rw] allowed_custom_roles + # @return [::Array<::String>] + # The list of allowed custom roles (ClusterRoles). If a ClusterRole is not + # part of this list, it cannot be used in a Scope RBACRoleBinding. If a + # ClusterRole in this list is in use, it cannot be removed from the list. + class FeatureSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # **RBAC RoleBinding Actuation**: An empty state left as an example Hub-wide + # Feature state. + class FeatureState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/service.rb b/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/service.rb index e2d4f9ce6337..5f2e01c613b9 100644 --- a/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/service.rb +++ b/google-cloud-gke_hub-v1/proto_docs/google/cloud/gkehub/v1/service.rb @@ -21,6 +21,397 @@ module Google module Cloud module GkeHub module V1 + # Request message for the `GkeHub.GetNamespace` method. + # @!attribute [rw] name + # @return [::String] + # Required. The Namespace resource name in the format + # `projects/*/locations/*/scopes/*/namespaces/*`. + class GetScopeNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to create a fleet namespace. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the Namespace will be + # created. Specified in the format `projects/*/locations/*/scopes/*`. + # @!attribute [rw] scope_namespace_id + # @return [::String] + # Required. Client chosen ID for the Namespace. `namespace_id` must be a + # valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @!attribute [rw] scope_namespace + # @return [::Google::Cloud::GkeHub::V1::Namespace] + # Required. The fleet namespace to create. + class CreateScopeNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a fleet namespace. + # @!attribute [rw] scope_namespace + # @return [::Google::Cloud::GkeHub::V1::Namespace] + # Required. A namespace with fields updated. The 'name' field in this + # namespace is used to identify the resource to update. Given 'updated' + # prefix to follow go/proto-best-practices-checkers#keyword_conflict + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to be updated. + class UpdateScopeNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a fleet namespace. + # @!attribute [rw] name + # @return [::String] + # Required. The Namespace resource name in the format + # `projects/*/locations/*/scopes/*/namespaces/*`. + class DeleteScopeNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list fleet namespaces. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/scopes/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Token returned by previous call to `ListFeatures` which + # specifies the position in the list from where to continue listing the + # resources. + class ListScopeNamespacesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of fleet namespaces. + # @!attribute [rw] scope_namespaces + # @return [::Array<::Google::Cloud::GkeHub::V1::Namespace>] + # The list of fleet namespaces + # @!attribute [rw] next_page_token + # @return [::String] + # A token to request the next page of resources from the + # `ListNamespaces` method. The value of an empty string means + # that there are no more resources to return. + class ListScopeNamespacesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GkeHub.GetScopeRBACRoleBinding` method. + # @!attribute [rw] name + # @return [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + class GetScopeRBACRoleBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to create a rbacrolebindings. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/scopes/*`. + # @!attribute [rw] rbacrolebinding_id + # @return [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @!attribute [rw] rbacrolebinding + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # Required. The rbacrolebindings to create. + class CreateScopeRBACRoleBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a scope rbacrolebinding. + # @!attribute [rw] rbacrolebinding + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # Required. A rbacrolebinding with fields updated. The 'name' field in this + # rbacrolebinding is used to identify the resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to be updated. + class UpdateScopeRBACRoleBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a Scope RBACRoleBinding. + # @!attribute [rw] name + # @return [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + class DeleteScopeRBACRoleBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list Scope RBACRoleBindings. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/scopes/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Token returned by previous call to `ListScopeRBACRoleBindings` + # which specifies the position in the list from where to continue listing the + # resources. + class ListScopeRBACRoleBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of Scope RBACRoleBindings. + # @!attribute [rw] rbacrolebindings + # @return [::Array<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # The list of Scope RBACRoleBindings. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to request the next page of resources from the + # `ListScopeRBACRoleBindings` method. The value of an empty string means + # that there are no more resources to return. + class ListScopeRBACRoleBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GkeHub.GetScope` method. + # @!attribute [rw] name + # @return [::String] + # Required. The Scope resource name in the format + # `projects/*/locations/*/scopes/*`. + class GetScopeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to create a Scope. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the Scope will be + # created. Specified in the format `projects/*/locations/*`. + # @!attribute [rw] scope_id + # @return [::String] + # Required. Client chosen ID for the Scope. `scope_id` must be a + # ???? + # @!attribute [rw] scope + # @return [::Google::Cloud::GkeHub::V1::Scope] + # Required. The Scope to create. + class CreateScopeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a Scope. + # @!attribute [rw] scope + # @return [::Google::Cloud::GkeHub::V1::Scope] + # Required. A Scope with fields updated. The 'name' field in this + # namespace is used to identify the resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to be updated. + class UpdateScopeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a Scope. + # @!attribute [rw] name + # @return [::String] + # Required. The Scope resource name in the format + # `projects/*/locations/*/scopes/*`. + class DeleteScopeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list Scopes. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the Scope will be listed. + # Specified in the format `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Token returned by previous call to `ListScopes` which + # specifies the position in the list from where to continue listing the + # resources. + class ListScopesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of Scopes. + # @!attribute [rw] scopes + # @return [::Array<::Google::Cloud::GkeHub::V1::Scope>] + # The list of Scopes + # @!attribute [rw] next_page_token + # @return [::String] + # A token to request the next page of resources from the + # `ListScopes` method. The value of an empty string means + # that there are no more resources to return. + class ListScopesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list permitted Scopes. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the Scope will be listed. + # Specified in the format `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Token returned by previous call to `ListPermittedScopes` which + # specifies the position in the list from where to continue listing the + # resources. + class ListPermittedScopesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of permitted Scopes. + # @!attribute [rw] scopes + # @return [::Array<::Google::Cloud::GkeHub::V1::Scope>] + # The list of permitted Scopes + # @!attribute [rw] next_page_token + # @return [::String] + # A token to request the next page of resources from the + # `ListPermittedScopes` method. The value of an empty string means + # that there are no more resources to return. + class ListPermittedScopesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GkeHub.GetMembershipBinding` method. + # @!attribute [rw] name + # @return [::String] + # Required. The MembershipBinding resource name in the format + # `projects/*/locations/*/memberships/*/bindings/*`. + class GetMembershipBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to create a MembershipBinding. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the MembershipBinding + # will be created. Specified in the format + # `projects/*/locations/*/memberships/*`. + # @!attribute [rw] membership_binding + # @return [::Google::Cloud::GkeHub::V1::MembershipBinding] + # Required. The MembershipBinding to create. + # @!attribute [rw] membership_binding_id + # @return [::String] + # Required. The ID to use for the MembershipBinding. + class CreateMembershipBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a MembershipBinding. + # @!attribute [rw] membership_binding + # @return [::Google::Cloud::GkeHub::V1::MembershipBinding] + # Required. The MembershipBinding object with fields updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to be updated. + class UpdateMembershipBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a Binding. + # @!attribute [rw] name + # @return [::String] + # Required. The MembershipBinding resource name in the format + # `projects/*/locations/*/memberships/*/bindings/*`. + class DeleteMembershipBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list MembershipBinding. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent Membership for which the MembershipBindings will be + # listed. Specified in the format `projects/*/locations/*/memberships/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Token returned by previous call to `ListMembershipBindings` which + # specifies the position in the list from where to continue listing the + # resources. + # @!attribute [rw] filter + # @return [::String] + # Optional. Lists MembershipBindings that match the filter expression, + # following the syntax outlined in https://google.aip.dev/160. + class ListMembershipBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of MembershipBindings. + # @!attribute [rw] membership_bindings + # @return [::Array<::Google::Cloud::GkeHub::V1::MembershipBinding>] + # The list of membership_bindings + # @!attribute [rw] next_page_token + # @return [::String] + # A token to request the next page of resources from the + # `ListMembershipBindings` method. The value of an empty string means + # that there are no more resources to return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # List of locations that could not be reached while fetching this list. + class ListMembershipBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request message for `GkeHub.ListMemberships` method. # @!attribute [rw] parent # @return [::String] @@ -68,6 +459,134 @@ class ListMembershipsRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request message for the `GkeHub.GetMembershipRBACRoleBinding` method. + # @!attribute [rw] name + # @return [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + class GetMembershipRBACRoleBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to create a rbacrolebindings. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/memberships/*`. + # @!attribute [rw] rbacrolebinding_id + # @return [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @!attribute [rw] rbacrolebinding + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # Required. The rbacrolebindings to create. + class CreateMembershipRBACRoleBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a membership rbacrolebinding. + # @!attribute [rw] rbacrolebinding + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # Required. A rbacrolebinding with fields updated. The 'name' field in this + # rbacrolebinding is used to identify the resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to be updated. + class UpdateMembershipRBACRoleBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a Membership RBACRoleBinding. + # @!attribute [rw] name + # @return [::String] + # Required. The RBACRoleBinding resource name in the format + # `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + class DeleteMembershipRBACRoleBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list Membership RBACRoleBindings. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the Features will be + # listed. Specified in the format `projects/*/locations/*/memberships/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Token returned by previous call to + # `ListMembershipRBACRoleBindings` which specifies the position in the list + # from where to continue listing the resources. + class ListMembershipRBACRoleBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of Membership RBACRoleBindings. + # @!attribute [rw] rbacrolebindings + # @return [::Array<::Google::Cloud::GkeHub::V1::RBACRoleBinding>] + # The list of Membership RBACRoleBindings. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to request the next page of resources from the + # `ListMembershipRBACRoleBindings` method. The value of an empty string means + # that there are no more resources to return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # List of locations that could not be reached while fetching this list. + class ListMembershipRBACRoleBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to generate a YAML of the RBAC policies for the specified + # RoleBinding and its associated impersonation resources. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the RBACRoleBinding will + # be created. Specified in the format `projects/*/locations/*/memberships/*`. + # @!attribute [rw] rbacrolebinding_id + # @return [::String] + # Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + # must be a valid RFC 1123 compliant DNS label: + # + # 1. At most 63 characters in length + # 2. It must consist of lower case alphanumeric characters or `-` + # 3. It must start and end with an alphanumeric character + # + # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + # with a maximum length of 63 characters. + # @!attribute [rw] rbacrolebinding + # @return [::Google::Cloud::GkeHub::V1::RBACRoleBinding] + # Required. The rbacrolebindings to generate the YAML for. + class GenerateMembershipRBACRoleBindingYAMLRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for GenerateRBACRoleBindingYAML. + # @!attribute [rw] role_bindings_yaml + # @return [::String] + # a yaml text blob including the RBAC policies. + class GenerateMembershipRBACRoleBindingYAMLResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Response message for the `GkeHub.ListMemberships` method. # @!attribute [rw] resources # @return [::Array<::Google::Cloud::GkeHub::V1::Membership>] @@ -95,6 +614,50 @@ class GetMembershipRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request to list Memberships bound to a Scope. + # @!attribute [rw] scope_name + # @return [::String] + # Required. Name of the Scope, in the format + # `projects/*/locations/global/scopes/*`, to which the Memberships are bound. + # @!attribute [rw] filter + # @return [::String] + # Optional. Lists Memberships that match the filter expression, following the + # syntax outlined in https://google.aip.dev/160. Currently, filtering + # can be done only based on Memberships's `name`, `labels`, `create_time`, + # `update_time`, and `unique_id`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. When requesting a 'page' of resources, `page_size` specifies + # number of resources to return. If unspecified or set to 0, all resources + # will be returned. Pagination is currently not supported; therefore, setting + # this field does not have any impact for now. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Token returned by previous call to `ListBoundMemberships` which + # specifies the position in the list from where to continue listing the + # resources. + class ListBoundMembershipsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of Memberships bound to a Scope. + # @!attribute [rw] memberships + # @return [::Array<::Google::Cloud::GkeHub::V1::Membership>] + # The list of Memberships bound to the given Scope. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # List of locations that could not be reached while fetching this list. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to request the next page of resources from the + # `ListBoundMemberships` method. The value of an empty string means that + # there are no more resources to return. + class ListBoundMembershipsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request message for the `GkeHub.CreateMembership` method. # @!attribute [rw] parent # @return [::String] @@ -318,6 +881,12 @@ class TypeMeta # @return [::String] # One or more fields to compare and use to sort the output. # See https://google.aip.dev/132#ordering. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # Optional. If set to true, the response will return partial results when + # some regions are unreachable and the unreachable field in Feature proto + # will be populated. If set to false, the request will fail when some regions + # are unreachable. class ListFeaturesRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -342,6 +911,12 @@ class ListFeaturesResponse # @return [::String] # Required. The Feature resource name in the format # `projects/*/locations/*/features/*` + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # Optional. If set to true, the response will return partial results when + # some regions are unreachable and the unreachable field in Feature proto + # will be populated. If set to false, the request will fail when some regions + # are unreachable. class GetFeatureRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -360,7 +935,7 @@ class GetFeatureRequest # The Feature resource to create. # @!attribute [rw] request_id # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID + # A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes after the first request. @@ -428,7 +1003,7 @@ class DeleteFeatureRequest # user-modifiable fields to match `resource`. # @!attribute [rw] request_id # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID + # A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes after the first request. @@ -446,6 +1021,90 @@ class UpdateFeatureRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request message for the `GkeHub.CreateFleet` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project and location) where the Fleet will be + # created. Specified in the format `projects/*/locations/*`. + # @!attribute [rw] fleet + # @return [::Google::Cloud::GkeHub::V1::Fleet] + # Required. The fleet to create. + class CreateFleetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GkeHub.GetFleet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The Fleet resource name in the format + # `projects/*/locations/*/fleets/*`. + class GetFleetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GkeHub.UpdateFleet` method. + # @!attribute [rw] fleet + # @return [::Google::Cloud::GkeHub::V1::Fleet] + # Required. The Fleet to update. + # + # The `name` field of the Fleet object identifies which fleet will be + # updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to be updated; + class UpdateFleetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GkeHub.DeleteFleet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The Fleet resource name in the format + # `projects/*/locations/*/fleets/*`. + class DeleteFleetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GkeHub.ListFleets` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The organization or project to list for Fleets under, in the + # format `organizations/*/locations/*` or `projects/*/locations/*`. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListFleets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListFleets` must match + # the call that provided the page token. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of fleets to return. The service may return + # fewer than this value. If unspecified, at most 200 fleets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + class ListFleetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `GkeHub.ListFleetsResponse` method. + # @!attribute [rw] fleets + # @return [::Array<::Google::Cloud::GkeHub::V1::Fleet>] + # The list of matching fleets. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # The token is only valid for 1h. + class ListFleetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Represents the metadata of the long-running operation. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] @@ -466,9 +1125,10 @@ class UpdateFeatureRequest # @return [::Boolean] # Output only. Identifies whether the user has requested cancellation # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. + # have + # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. # @!attribute [r] api_version # @return [::String] # Output only. API version used to start the operation. diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/create_fleet.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/create_fleet.rb new file mode 100644 index 000000000000..c77b8b0a1c47 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/create_fleet.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_CreateFleet_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the create_fleet call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#create_fleet. +# +def create_fleet + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::CreateFleetRequest.new + + # Call the create_fleet method. + result = client.create_fleet request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_CreateFleet_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership_binding.rb new file mode 100644 index 000000000000..29f4afd18ec7 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_CreateMembershipBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the create_membership_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#create_membership_binding. +# +def create_membership_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest.new + + # Call the create_membership_binding method. + result = client.create_membership_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_CreateMembershipBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership_rbac_role_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership_rbac_role_binding.rb new file mode 100644 index 000000000000..b0f6ca1bd720 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership_rbac_role_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_CreateMembershipRBACRoleBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the create_membership_rbac_role_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#create_membership_rbac_role_binding. +# +def create_membership_rbac_role_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest.new + + # Call the create_membership_rbac_role_binding method. + result = client.create_membership_rbac_role_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_CreateMembershipRBACRoleBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope.rb new file mode 100644 index 000000000000..f11c5d23043f --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_CreateScope_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the create_scope call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope. +# +def create_scope + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::CreateScopeRequest.new + + # Call the create_scope method. + result = client.create_scope request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_CreateScope_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope_namespace.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope_namespace.rb new file mode 100644 index 000000000000..5d9f6e8667d9 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope_namespace.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_CreateScopeNamespace_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the create_scope_namespace call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope_namespace. +# +def create_scope_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest.new + + # Call the create_scope_namespace method. + result = client.create_scope_namespace request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_CreateScopeNamespace_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope_rbac_role_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope_rbac_role_binding.rb new file mode 100644 index 000000000000..db1adbe2cacb --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/create_scope_rbac_role_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_CreateScopeRBACRoleBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the create_scope_rbac_role_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope_rbac_role_binding. +# +def create_scope_rbac_role_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest.new + + # Call the create_scope_rbac_role_binding method. + result = client.create_scope_rbac_role_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_CreateScopeRBACRoleBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_fleet.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_fleet.rb new file mode 100644 index 000000000000..fd1468fd9659 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_fleet.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_DeleteFleet_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the delete_fleet call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#delete_fleet. +# +def delete_fleet + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::DeleteFleetRequest.new + + # Call the delete_fleet method. + result = client.delete_fleet request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_DeleteFleet_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership_binding.rb new file mode 100644 index 000000000000..eb004dbaff12 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_DeleteMembershipBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the delete_membership_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#delete_membership_binding. +# +def delete_membership_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest.new + + # Call the delete_membership_binding method. + result = client.delete_membership_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_DeleteMembershipBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership_rbac_role_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership_rbac_role_binding.rb new file mode 100644 index 000000000000..526b1a039aeb --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership_rbac_role_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_DeleteMembershipRBACRoleBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the delete_membership_rbac_role_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#delete_membership_rbac_role_binding. +# +def delete_membership_rbac_role_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest.new + + # Call the delete_membership_rbac_role_binding method. + result = client.delete_membership_rbac_role_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_DeleteMembershipRBACRoleBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope.rb new file mode 100644 index 000000000000..b9026dc287e3 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_DeleteScope_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the delete_scope call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope. +# +def delete_scope + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::DeleteScopeRequest.new + + # Call the delete_scope method. + result = client.delete_scope request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_DeleteScope_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope_namespace.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope_namespace.rb new file mode 100644 index 000000000000..97c934ddce40 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope_namespace.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_DeleteScopeNamespace_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the delete_scope_namespace call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope_namespace. +# +def delete_scope_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest.new + + # Call the delete_scope_namespace method. + result = client.delete_scope_namespace request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_DeleteScopeNamespace_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope_rbac_role_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope_rbac_role_binding.rb new file mode 100644 index 000000000000..9b225d7f0e23 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_scope_rbac_role_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_DeleteScopeRBACRoleBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the delete_scope_rbac_role_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope_rbac_role_binding. +# +def delete_scope_rbac_role_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest.new + + # Call the delete_scope_rbac_role_binding method. + result = client.delete_scope_rbac_role_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_DeleteScopeRBACRoleBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/generate_membership_rbac_role_binding_yaml.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/generate_membership_rbac_role_binding_yaml.rb new file mode 100644 index 000000000000..a1ede83cb4c3 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/generate_membership_rbac_role_binding_yaml.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_GenerateMembershipRBACRoleBindingYAML_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the generate_membership_rbac_role_binding_yaml call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#generate_membership_rbac_role_binding_yaml. +# +def generate_membership_rbac_role_binding_yaml + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest.new + + # Call the generate_membership_rbac_role_binding_yaml method. + result = client.generate_membership_rbac_role_binding_yaml request + + # The returned object is of type Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse. + p result +end +# [END gkehub_v1_generated_GkeHub_GenerateMembershipRBACRoleBindingYAML_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/get_fleet.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/get_fleet.rb new file mode 100644 index 000000000000..8cdaad109b91 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/get_fleet.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_GetFleet_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the get_fleet call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#get_fleet. +# +def get_fleet + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GetFleetRequest.new + + # Call the get_fleet method. + result = client.get_fleet request + + # The returned object is of type Google::Cloud::GkeHub::V1::Fleet. + p result +end +# [END gkehub_v1_generated_GkeHub_GetFleet_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership_binding.rb new file mode 100644 index 000000000000..19829bc7ac58 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership_binding.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_GetMembershipBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the get_membership_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#get_membership_binding. +# +def get_membership_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GetMembershipBindingRequest.new + + # Call the get_membership_binding method. + result = client.get_membership_binding request + + # The returned object is of type Google::Cloud::GkeHub::V1::MembershipBinding. + p result +end +# [END gkehub_v1_generated_GkeHub_GetMembershipBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership_rbac_role_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership_rbac_role_binding.rb new file mode 100644 index 000000000000..f174431da9ec --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership_rbac_role_binding.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_GetMembershipRBACRoleBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the get_membership_rbac_role_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#get_membership_rbac_role_binding. +# +def get_membership_rbac_role_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest.new + + # Call the get_membership_rbac_role_binding method. + result = client.get_membership_rbac_role_binding request + + # The returned object is of type Google::Cloud::GkeHub::V1::RBACRoleBinding. + p result +end +# [END gkehub_v1_generated_GkeHub_GetMembershipRBACRoleBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope.rb new file mode 100644 index 000000000000..5670d5d6bb95 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_GetScope_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the get_scope call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope. +# +def get_scope + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GetScopeRequest.new + + # Call the get_scope method. + result = client.get_scope request + + # The returned object is of type Google::Cloud::GkeHub::V1::Scope. + p result +end +# [END gkehub_v1_generated_GkeHub_GetScope_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope_namespace.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope_namespace.rb new file mode 100644 index 000000000000..b90151be11dd --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_GetScopeNamespace_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the get_scope_namespace call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope_namespace. +# +def get_scope_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest.new + + # Call the get_scope_namespace method. + result = client.get_scope_namespace request + + # The returned object is of type Google::Cloud::GkeHub::V1::Namespace. + p result +end +# [END gkehub_v1_generated_GkeHub_GetScopeNamespace_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope_rbac_role_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope_rbac_role_binding.rb new file mode 100644 index 000000000000..fa7993b6704b --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/get_scope_rbac_role_binding.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_GetScopeRBACRoleBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the get_scope_rbac_role_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope_rbac_role_binding. +# +def get_scope_rbac_role_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest.new + + # Call the get_scope_rbac_role_binding method. + result = client.get_scope_rbac_role_binding request + + # The returned object is of type Google::Cloud::GkeHub::V1::RBACRoleBinding. + p result +end +# [END gkehub_v1_generated_GkeHub_GetScopeRBACRoleBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_bound_memberships.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_bound_memberships.rb new file mode 100644 index 000000000000..086f3074a3c8 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_bound_memberships.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_ListBoundMemberships_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the list_bound_memberships call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_bound_memberships. +# +def list_bound_memberships + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest.new + + # Call the list_bound_memberships method. + result = client.list_bound_memberships request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::GkeHub::V1::Membership. + p item + end +end +# [END gkehub_v1_generated_GkeHub_ListBoundMemberships_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_fleets.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_fleets.rb new file mode 100644 index 000000000000..0c8eb5240327 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_fleets.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_ListFleets_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the list_fleets call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_fleets. +# +def list_fleets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListFleetsRequest.new + + # Call the list_fleets method. + result = client.list_fleets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::GkeHub::V1::Fleet. + p item + end +end +# [END gkehub_v1_generated_GkeHub_ListFleets_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_membership_bindings.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_membership_bindings.rb new file mode 100644 index 000000000000..7b37dfa7c06b --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_membership_bindings.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_ListMembershipBindings_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the list_membership_bindings call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_membership_bindings. +# +def list_membership_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest.new + + # Call the list_membership_bindings method. + result = client.list_membership_bindings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::GkeHub::V1::MembershipBinding. + p item + end +end +# [END gkehub_v1_generated_GkeHub_ListMembershipBindings_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_membership_rbac_role_bindings.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_membership_rbac_role_bindings.rb new file mode 100644 index 000000000000..96971e399c00 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_membership_rbac_role_bindings.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_ListMembershipRBACRoleBindings_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the list_membership_rbac_role_bindings call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_membership_rbac_role_bindings. +# +def list_membership_rbac_role_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest.new + + # Call the list_membership_rbac_role_bindings method. + result = client.list_membership_rbac_role_bindings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::GkeHub::V1::RBACRoleBinding. + p item + end +end +# [END gkehub_v1_generated_GkeHub_ListMembershipRBACRoleBindings_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_permitted_scopes.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_permitted_scopes.rb new file mode 100644 index 000000000000..39346d3d3afd --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_permitted_scopes.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_ListPermittedScopes_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the list_permitted_scopes call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_permitted_scopes. +# +def list_permitted_scopes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListPermittedScopesRequest.new + + # Call the list_permitted_scopes method. + result = client.list_permitted_scopes request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::GkeHub::V1::Scope. + p item + end +end +# [END gkehub_v1_generated_GkeHub_ListPermittedScopes_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_scope_namespaces.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_scope_namespaces.rb new file mode 100644 index 000000000000..0032bdea979d --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_scope_namespaces.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_ListScopeNamespaces_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the list_scope_namespaces call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_scope_namespaces. +# +def list_scope_namespaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest.new + + # Call the list_scope_namespaces method. + result = client.list_scope_namespaces request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::GkeHub::V1::Namespace. + p item + end +end +# [END gkehub_v1_generated_GkeHub_ListScopeNamespaces_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_scope_rbac_role_bindings.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_scope_rbac_role_bindings.rb new file mode 100644 index 000000000000..60b54e79a8fe --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_scope_rbac_role_bindings.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_ListScopeRBACRoleBindings_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the list_scope_rbac_role_bindings call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_scope_rbac_role_bindings. +# +def list_scope_rbac_role_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest.new + + # Call the list_scope_rbac_role_bindings method. + result = client.list_scope_rbac_role_bindings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::GkeHub::V1::RBACRoleBinding. + p item + end +end +# [END gkehub_v1_generated_GkeHub_ListScopeRBACRoleBindings_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_scopes.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_scopes.rb new file mode 100644 index 000000000000..cc3c7230c516 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_scopes.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_ListScopes_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the list_scopes call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_scopes. +# +def list_scopes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListScopesRequest.new + + # Call the list_scopes method. + result = client.list_scopes request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::GkeHub::V1::Scope. + p item + end +end +# [END gkehub_v1_generated_GkeHub_ListScopes_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/update_fleet.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/update_fleet.rb new file mode 100644 index 000000000000..bdbf68efa231 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/update_fleet.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_UpdateFleet_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the update_fleet call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#update_fleet. +# +def update_fleet + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::UpdateFleetRequest.new + + # Call the update_fleet method. + result = client.update_fleet request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_UpdateFleet_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership_binding.rb new file mode 100644 index 000000000000..7151c55c6fc9 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_UpdateMembershipBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the update_membership_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#update_membership_binding. +# +def update_membership_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest.new + + # Call the update_membership_binding method. + result = client.update_membership_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_UpdateMembershipBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership_rbac_role_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership_rbac_role_binding.rb new file mode 100644 index 000000000000..1ec7b8a81a76 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership_rbac_role_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_UpdateMembershipRBACRoleBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the update_membership_rbac_role_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#update_membership_rbac_role_binding. +# +def update_membership_rbac_role_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest.new + + # Call the update_membership_rbac_role_binding method. + result = client.update_membership_rbac_role_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_UpdateMembershipRBACRoleBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope.rb new file mode 100644 index 000000000000..213660d3bc6d --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_UpdateScope_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the update_scope call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope. +# +def update_scope + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::UpdateScopeRequest.new + + # Call the update_scope method. + result = client.update_scope request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_UpdateScope_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope_namespace.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope_namespace.rb new file mode 100644 index 000000000000..536b90d986aa --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope_namespace.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_UpdateScopeNamespace_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the update_scope_namespace call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope_namespace. +# +def update_scope_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest.new + + # Call the update_scope_namespace method. + result = client.update_scope_namespace request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_UpdateScopeNamespace_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope_rbac_role_binding.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope_rbac_role_binding.rb new file mode 100644 index 000000000000..a5bb349701d0 --- /dev/null +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/update_scope_rbac_role_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START gkehub_v1_generated_GkeHub_UpdateScopeRBACRoleBinding_sync] +require "google/cloud/gke_hub/v1" + +## +# Snippet for the update_scope_rbac_role_binding call in the GkeHub service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope_rbac_role_binding. +# +def update_scope_rbac_role_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest.new + + # Call the update_scope_rbac_role_binding method. + result = client.update_scope_rbac_role_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END gkehub_v1_generated_GkeHub_UpdateScopeRBACRoleBinding_sync] diff --git a/google-cloud-gke_hub-v1/snippets/snippet_metadata_google.cloud.gkehub.v1.json b/google-cloud-gke_hub-v1/snippets/snippet_metadata_google.cloud.gkehub.v1.json index becf91c839d6..494027e6799b 100644 --- a/google-cloud-gke_hub-v1/snippets/snippet_metadata_google.cloud.gkehub.v1.json +++ b/google-cloud-gke_hub-v1/snippets/snippet_metadata_google.cloud.gkehub.v1.json @@ -51,6 +51,46 @@ } ] }, + { + "region_tag": "gkehub_v1_generated_GkeHub_ListBoundMemberships_sync", + "title": "Snippet for the list_bound_memberships call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#list_bound_memberships.", + "file": "gke_hub/list_bound_memberships.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_bound_memberships", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#list_bound_memberships", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::ListBoundMembershipsResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "ListBoundMemberships", + "full_name": "google.cloud.gkehub.v1.GkeHub.ListBoundMemberships", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, { "region_tag": "gkehub_v1_generated_GkeHub_ListFeatures_sync", "title": "Snippet for the list_features call in the GkeHub service", @@ -450,6 +490,1286 @@ "type": "FULL" } ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_CreateFleet_sync", + "title": "Snippet for the create_fleet call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#create_fleet.", + "file": "gke_hub/create_fleet.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_fleet", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#create_fleet", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::CreateFleetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "CreateFleet", + "full_name": "google.cloud.gkehub.v1.GkeHub.CreateFleet", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_GetFleet_sync", + "title": "Snippet for the get_fleet call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#get_fleet.", + "file": "gke_hub/get_fleet.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_fleet", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#get_fleet", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::GetFleetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::Fleet", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "GetFleet", + "full_name": "google.cloud.gkehub.v1.GkeHub.GetFleet", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_UpdateFleet_sync", + "title": "Snippet for the update_fleet call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#update_fleet.", + "file": "gke_hub/update_fleet.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_fleet", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#update_fleet", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::UpdateFleetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "UpdateFleet", + "full_name": "google.cloud.gkehub.v1.GkeHub.UpdateFleet", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_DeleteFleet_sync", + "title": "Snippet for the delete_fleet call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#delete_fleet.", + "file": "gke_hub/delete_fleet.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_fleet", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#delete_fleet", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::DeleteFleetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "DeleteFleet", + "full_name": "google.cloud.gkehub.v1.GkeHub.DeleteFleet", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_ListFleets_sync", + "title": "Snippet for the list_fleets call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#list_fleets.", + "file": "gke_hub/list_fleets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_fleets", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#list_fleets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::ListFleetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::ListFleetsResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "ListFleets", + "full_name": "google.cloud.gkehub.v1.GkeHub.ListFleets", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_GetScopeNamespace_sync", + "title": "Snippet for the get_scope_namespace call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope_namespace.", + "file": "gke_hub/get_scope_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_scope_namespace", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::Namespace", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "GetScopeNamespace", + "full_name": "google.cloud.gkehub.v1.GkeHub.GetScopeNamespace", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_CreateScopeNamespace_sync", + "title": "Snippet for the create_scope_namespace call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope_namespace.", + "file": "gke_hub/create_scope_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_scope_namespace", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "CreateScopeNamespace", + "full_name": "google.cloud.gkehub.v1.GkeHub.CreateScopeNamespace", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_UpdateScopeNamespace_sync", + "title": "Snippet for the update_scope_namespace call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope_namespace.", + "file": "gke_hub/update_scope_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_scope_namespace", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "UpdateScopeNamespace", + "full_name": "google.cloud.gkehub.v1.GkeHub.UpdateScopeNamespace", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_DeleteScopeNamespace_sync", + "title": "Snippet for the delete_scope_namespace call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope_namespace.", + "file": "gke_hub/delete_scope_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_scope_namespace", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "DeleteScopeNamespace", + "full_name": "google.cloud.gkehub.v1.GkeHub.DeleteScopeNamespace", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_ListScopeNamespaces_sync", + "title": "Snippet for the list_scope_namespaces call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#list_scope_namespaces.", + "file": "gke_hub/list_scope_namespaces.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_scope_namespaces", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#list_scope_namespaces", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::ListScopeNamespacesResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "ListScopeNamespaces", + "full_name": "google.cloud.gkehub.v1.GkeHub.ListScopeNamespaces", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_GetScopeRBACRoleBinding_sync", + "title": "Snippet for the get_scope_rbac_role_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope_rbac_role_binding.", + "file": "gke_hub/get_scope_rbac_role_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_scope_rbac_role_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope_rbac_role_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::RBACRoleBinding", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "GetScopeRBACRoleBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.GetScopeRBACRoleBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_CreateScopeRBACRoleBinding_sync", + "title": "Snippet for the create_scope_rbac_role_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope_rbac_role_binding.", + "file": "gke_hub/create_scope_rbac_role_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_scope_rbac_role_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope_rbac_role_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "CreateScopeRBACRoleBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.CreateScopeRBACRoleBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_UpdateScopeRBACRoleBinding_sync", + "title": "Snippet for the update_scope_rbac_role_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope_rbac_role_binding.", + "file": "gke_hub/update_scope_rbac_role_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_scope_rbac_role_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope_rbac_role_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "UpdateScopeRBACRoleBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.UpdateScopeRBACRoleBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_DeleteScopeRBACRoleBinding_sync", + "title": "Snippet for the delete_scope_rbac_role_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope_rbac_role_binding.", + "file": "gke_hub/delete_scope_rbac_role_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_scope_rbac_role_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope_rbac_role_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "DeleteScopeRBACRoleBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.DeleteScopeRBACRoleBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_ListScopeRBACRoleBindings_sync", + "title": "Snippet for the list_scope_rbac_role_bindings call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#list_scope_rbac_role_bindings.", + "file": "gke_hub/list_scope_rbac_role_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_scope_rbac_role_bindings", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#list_scope_rbac_role_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "ListScopeRBACRoleBindings", + "full_name": "google.cloud.gkehub.v1.GkeHub.ListScopeRBACRoleBindings", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_GetScope_sync", + "title": "Snippet for the get_scope call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope.", + "file": "gke_hub/get_scope.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_scope", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#get_scope", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::GetScopeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::Scope", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "GetScope", + "full_name": "google.cloud.gkehub.v1.GkeHub.GetScope", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_CreateScope_sync", + "title": "Snippet for the create_scope call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope.", + "file": "gke_hub/create_scope.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_scope", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#create_scope", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::CreateScopeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "CreateScope", + "full_name": "google.cloud.gkehub.v1.GkeHub.CreateScope", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_UpdateScope_sync", + "title": "Snippet for the update_scope call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope.", + "file": "gke_hub/update_scope.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_scope", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#update_scope", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::UpdateScopeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "UpdateScope", + "full_name": "google.cloud.gkehub.v1.GkeHub.UpdateScope", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_DeleteScope_sync", + "title": "Snippet for the delete_scope call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope.", + "file": "gke_hub/delete_scope.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_scope", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#delete_scope", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::DeleteScopeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "DeleteScope", + "full_name": "google.cloud.gkehub.v1.GkeHub.DeleteScope", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_ListScopes_sync", + "title": "Snippet for the list_scopes call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#list_scopes.", + "file": "gke_hub/list_scopes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_scopes", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#list_scopes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::ListScopesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::ListScopesResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "ListScopes", + "full_name": "google.cloud.gkehub.v1.GkeHub.ListScopes", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_ListPermittedScopes_sync", + "title": "Snippet for the list_permitted_scopes call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#list_permitted_scopes.", + "file": "gke_hub/list_permitted_scopes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_permitted_scopes", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#list_permitted_scopes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::ListPermittedScopesResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "ListPermittedScopes", + "full_name": "google.cloud.gkehub.v1.GkeHub.ListPermittedScopes", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_GetMembershipBinding_sync", + "title": "Snippet for the get_membership_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#get_membership_binding.", + "file": "gke_hub/get_membership_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_membership_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#get_membership_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::MembershipBinding", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "GetMembershipBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.GetMembershipBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_CreateMembershipBinding_sync", + "title": "Snippet for the create_membership_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#create_membership_binding.", + "file": "gke_hub/create_membership_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_membership_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#create_membership_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "CreateMembershipBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.CreateMembershipBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_UpdateMembershipBinding_sync", + "title": "Snippet for the update_membership_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#update_membership_binding.", + "file": "gke_hub/update_membership_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_membership_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#update_membership_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "UpdateMembershipBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.UpdateMembershipBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_DeleteMembershipBinding_sync", + "title": "Snippet for the delete_membership_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#delete_membership_binding.", + "file": "gke_hub/delete_membership_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_membership_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#delete_membership_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "DeleteMembershipBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.DeleteMembershipBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_ListMembershipBindings_sync", + "title": "Snippet for the list_membership_bindings call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#list_membership_bindings.", + "file": "gke_hub/list_membership_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_membership_bindings", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#list_membership_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::ListMembershipBindingsResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "ListMembershipBindings", + "full_name": "google.cloud.gkehub.v1.GkeHub.ListMembershipBindings", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_GetMembershipRBACRoleBinding_sync", + "title": "Snippet for the get_membership_rbac_role_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#get_membership_rbac_role_binding.", + "file": "gke_hub/get_membership_rbac_role_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_membership_rbac_role_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#get_membership_rbac_role_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::RBACRoleBinding", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "GetMembershipRBACRoleBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.GetMembershipRBACRoleBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_CreateMembershipRBACRoleBinding_sync", + "title": "Snippet for the create_membership_rbac_role_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#create_membership_rbac_role_binding.", + "file": "gke_hub/create_membership_rbac_role_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_membership_rbac_role_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#create_membership_rbac_role_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "CreateMembershipRBACRoleBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.CreateMembershipRBACRoleBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_UpdateMembershipRBACRoleBinding_sync", + "title": "Snippet for the update_membership_rbac_role_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#update_membership_rbac_role_binding.", + "file": "gke_hub/update_membership_rbac_role_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_membership_rbac_role_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#update_membership_rbac_role_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "UpdateMembershipRBACRoleBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.UpdateMembershipRBACRoleBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_DeleteMembershipRBACRoleBinding_sync", + "title": "Snippet for the delete_membership_rbac_role_binding call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#delete_membership_rbac_role_binding.", + "file": "gke_hub/delete_membership_rbac_role_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_membership_rbac_role_binding", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#delete_membership_rbac_role_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "DeleteMembershipRBACRoleBinding", + "full_name": "google.cloud.gkehub.v1.GkeHub.DeleteMembershipRBACRoleBinding", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_ListMembershipRBACRoleBindings_sync", + "title": "Snippet for the list_membership_rbac_role_bindings call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#list_membership_rbac_role_bindings.", + "file": "gke_hub/list_membership_rbac_role_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_membership_rbac_role_bindings", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#list_membership_rbac_role_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "ListMembershipRBACRoleBindings", + "full_name": "google.cloud.gkehub.v1.GkeHub.ListMembershipRBACRoleBindings", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "gkehub_v1_generated_GkeHub_GenerateMembershipRBACRoleBindingYAML_sync", + "title": "Snippet for the generate_membership_rbac_role_binding_yaml call in the GkeHub service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::GkeHub::V1::GkeHub::Client#generate_membership_rbac_role_binding_yaml.", + "file": "gke_hub/generate_membership_rbac_role_binding_yaml.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_membership_rbac_role_binding_yaml", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client#generate_membership_rbac_role_binding_yaml", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse", + "client": { + "short_name": "GkeHub::Client", + "full_name": "::Google::Cloud::GkeHub::V1::GkeHub::Client" + }, + "method": { + "short_name": "GenerateMembershipRBACRoleBindingYAML", + "full_name": "google.cloud.gkehub.v1.GkeHub.GenerateMembershipRBACRoleBindingYAML", + "service": { + "short_name": "GkeHub", + "full_name": "google.cloud.gkehub.v1.GkeHub" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb index cac4f638c28c..ec361062b019 100644 --- a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb +++ b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb @@ -53,6 +53,21 @@ def test_feature_path end end + def test_fleet_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.fleet_path project: "value0", location: "value1", fleet: "value2" + assert_equal "projects/value0/locations/value1/fleets/value2", path + + path = client.fleet_path organization: "value0", location: "value1", fleet: "value2" + assert_equal "organizations/value0/locations/value1/fleets/value2", path + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do @@ -76,4 +91,55 @@ def test_membership_path assert_equal "projects/value0/locations/value1/memberships/value2", path end end + + def test_membership_binding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.membership_binding_path project: "value0", location: "value1", membership: "value2", membershipbinding: "value3" + assert_equal "projects/value0/locations/value1/memberships/value2/bindings/value3", path + end + end + + def test_namespace_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.namespace_path project: "value0", location: "value1", scope: "value2", namespace: "value3" + assert_equal "projects/value0/locations/value1/scopes/value2/namespaces/value3", path + end + end + + def test_rbac_role_binding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.rbac_role_binding_path project: "value0", location: "value1", scope: "value2", rbacrolebinding: "value3" + assert_equal "projects/value0/locations/value1/scopes/value2/rbacrolebindings/value3", path + + path = client.rbac_role_binding_path project: "value0", location: "value1", membership: "value2", rbacrolebinding: "value3" + assert_equal "projects/value0/locations/value1/memberships/value2/rbacrolebindings/value3", path + end + end + + def test_scope_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.scope_path project: "value0", location: "value1", scope: "value2" + assert_equal "projects/value0/locations/value1/scopes/value2", path + end + end end diff --git a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_rest_test.rb b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_rest_test.rb index bf49ee0872cf..de5c1fb50325 100644 --- a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_rest_test.rb +++ b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_rest_test.rb @@ -136,6 +136,63 @@ def test_list_memberships end end + def test_list_bound_memberships + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::ListBoundMembershipsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + scope_name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_bound_memberships_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_list_bound_memberships_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_bound_memberships_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_bound_memberships({ scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_bound_memberships scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_bound_memberships ::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest.new(scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_bound_memberships({ scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_bound_memberships(::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest.new(scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_bound_memberships_client_stub.call_count + end + end + end + def test_list_features # Create test objects. client_result = ::Google::Cloud::GkeHub::V1::ListFeaturesResponse.new @@ -149,6 +206,7 @@ def test_list_features page_token = "hello world" filter = "hello world" order_by = "hello world" + return_partial_success = true list_features_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| assert options.metadata.key? :"x-goog-api-client" @@ -164,27 +222,27 @@ def test_list_features end # Use hash object - client.list_features({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + client.list_features({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success }) do |_result, response| assert_equal http_response, response.underlying_op end # Use named arguments - client.list_features parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + client.list_features parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object - client.list_features ::Google::Cloud::GkeHub::V1::ListFeaturesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + client.list_features ::Google::Cloud::GkeHub::V1::ListFeaturesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success) do |_result, response| assert_equal http_response, response.underlying_op end # Use hash object with options - client.list_features({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + client.list_features({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success }, call_options) do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object with options - client.list_features(::Google::Cloud::GkeHub::V1::ListFeaturesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + client.list_features(::Google::Cloud::GkeHub::V1::ListFeaturesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success), call_options) do |_result, response| assert_equal http_response, response.underlying_op end @@ -257,6 +315,7 @@ def test_get_feature # Create request parameters for a unary method. name = "hello world" + return_partial_success = true get_feature_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| assert options.metadata.key? :"x-goog-api-client" @@ -272,27 +331,27 @@ def test_get_feature end # Use hash object - client.get_feature({ name: name }) do |_result, response| + client.get_feature({ name: name, return_partial_success: return_partial_success }) do |_result, response| assert_equal http_response, response.underlying_op end # Use named arguments - client.get_feature name: name do |_result, response| + client.get_feature name: name, return_partial_success: return_partial_success do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object - client.get_feature ::Google::Cloud::GkeHub::V1::GetFeatureRequest.new(name: name) do |_result, response| + client.get_feature ::Google::Cloud::GkeHub::V1::GetFeatureRequest.new(name: name, return_partial_success: return_partial_success) do |_result, response| assert_equal http_response, response.underlying_op end # Use hash object with options - client.get_feature({ name: name }, call_options) do |_result, response| + client.get_feature({ name: name, return_partial_success: return_partial_success }, call_options) do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object with options - client.get_feature(::Google::Cloud::GkeHub::V1::GetFeatureRequest.new(name: name), call_options) do |_result, response| + client.get_feature(::Google::Cloud::GkeHub::V1::GetFeatureRequest.new(name: name, return_partial_success: return_partial_success), call_options) do |_result, response| assert_equal http_response, response.underlying_op end @@ -702,6 +761,1768 @@ def test_generate_connect_manifest end end + def test_create_fleet + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + fleet = {} + + create_fleet_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_create_fleet_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_fleet_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_fleet({ parent: parent, fleet: fleet }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_fleet parent: parent, fleet: fleet do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_fleet ::Google::Cloud::GkeHub::V1::CreateFleetRequest.new(parent: parent, fleet: fleet) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_fleet({ parent: parent, fleet: fleet }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_fleet(::Google::Cloud::GkeHub::V1::CreateFleetRequest.new(parent: parent, fleet: fleet), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_fleet_client_stub.call_count + end + end + end + + def test_get_fleet + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::Fleet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_fleet_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_get_fleet_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_fleet_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_fleet({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_fleet name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_fleet ::Google::Cloud::GkeHub::V1::GetFleetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_fleet({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_fleet(::Google::Cloud::GkeHub::V1::GetFleetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_fleet_client_stub.call_count + end + end + end + + def test_update_fleet + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + fleet = {} + update_mask = {} + + update_fleet_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_update_fleet_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_fleet_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_fleet({ fleet: fleet, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_fleet fleet: fleet, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_fleet ::Google::Cloud::GkeHub::V1::UpdateFleetRequest.new(fleet: fleet, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_fleet({ fleet: fleet, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_fleet(::Google::Cloud::GkeHub::V1::UpdateFleetRequest.new(fleet: fleet, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_fleet_client_stub.call_count + end + end + end + + def test_delete_fleet + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_fleet_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_delete_fleet_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_fleet_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_fleet({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_fleet name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_fleet ::Google::Cloud::GkeHub::V1::DeleteFleetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_fleet({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_fleet(::Google::Cloud::GkeHub::V1::DeleteFleetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_fleet_client_stub.call_count + end + end + end + + def test_list_fleets + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::ListFleetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_fleets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_list_fleets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_fleets_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_fleets({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_fleets parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_fleets ::Google::Cloud::GkeHub::V1::ListFleetsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_fleets({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_fleets(::Google::Cloud::GkeHub::V1::ListFleetsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_fleets_client_stub.call_count + end + end + end + + def test_get_scope_namespace + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::Namespace.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scope_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_get_scope_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_scope_namespace_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_scope_namespace({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_scope_namespace name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_scope_namespace ::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_scope_namespace({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_scope_namespace(::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_scope_namespace_client_stub.call_count + end + end + end + + def test_create_scope_namespace + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + scope_namespace_id = "hello world" + scope_namespace = {} + + create_scope_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_create_scope_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_scope_namespace_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_scope_namespace({ parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_scope_namespace parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_scope_namespace ::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest.new(parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_scope_namespace({ parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_scope_namespace(::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest.new(parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_scope_namespace_client_stub.call_count + end + end + end + + def test_update_scope_namespace + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + scope_namespace = {} + update_mask = {} + + update_scope_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_update_scope_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_scope_namespace_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_scope_namespace({ scope_namespace: scope_namespace, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_scope_namespace scope_namespace: scope_namespace, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_scope_namespace ::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest.new(scope_namespace: scope_namespace, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_scope_namespace({ scope_namespace: scope_namespace, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_scope_namespace(::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest.new(scope_namespace: scope_namespace, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_scope_namespace_client_stub.call_count + end + end + end + + def test_delete_scope_namespace + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_scope_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_delete_scope_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_scope_namespace_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_scope_namespace({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_scope_namespace name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_scope_namespace ::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_scope_namespace({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_scope_namespace(::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_scope_namespace_client_stub.call_count + end + end + end + + def test_list_scope_namespaces + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::ListScopeNamespacesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_scope_namespaces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_list_scope_namespaces_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_scope_namespaces_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_scope_namespaces({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_scope_namespaces parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_scope_namespaces ::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_scope_namespaces({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_scope_namespaces(::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_scope_namespaces_client_stub.call_count + end + end + end + + def test_get_scope_rbac_role_binding + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::RBACRoleBinding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scope_rbac_role_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_get_scope_rbac_role_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_scope_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_scope_rbac_role_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_scope_rbac_role_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_scope_rbac_role_binding ::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_scope_rbac_role_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_scope_rbac_role_binding(::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_scope_rbac_role_binding_client_stub.call_count + end + end + end + + def test_create_scope_rbac_role_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + rbacrolebinding_id = "hello world" + rbacrolebinding = {} + + create_scope_rbac_role_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_create_scope_rbac_role_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_scope_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_scope_rbac_role_binding({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_scope_rbac_role_binding parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_scope_rbac_role_binding ::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_scope_rbac_role_binding({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_scope_rbac_role_binding(::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_scope_rbac_role_binding_client_stub.call_count + end + end + end + + def test_update_scope_rbac_role_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + rbacrolebinding = {} + update_mask = {} + + update_scope_rbac_role_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_update_scope_rbac_role_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_scope_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_scope_rbac_role_binding({ rbacrolebinding: rbacrolebinding, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_scope_rbac_role_binding rbacrolebinding: rbacrolebinding, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_scope_rbac_role_binding ::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest.new(rbacrolebinding: rbacrolebinding, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_scope_rbac_role_binding({ rbacrolebinding: rbacrolebinding, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_scope_rbac_role_binding(::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest.new(rbacrolebinding: rbacrolebinding, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_scope_rbac_role_binding_client_stub.call_count + end + end + end + + def test_delete_scope_rbac_role_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_scope_rbac_role_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_delete_scope_rbac_role_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_scope_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_scope_rbac_role_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_scope_rbac_role_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_scope_rbac_role_binding ::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_scope_rbac_role_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_scope_rbac_role_binding(::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_scope_rbac_role_binding_client_stub.call_count + end + end + end + + def test_list_scope_rbac_role_bindings + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_scope_rbac_role_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_list_scope_rbac_role_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_scope_rbac_role_bindings_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_scope_rbac_role_bindings({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_scope_rbac_role_bindings parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_scope_rbac_role_bindings ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_scope_rbac_role_bindings({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_scope_rbac_role_bindings(::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_scope_rbac_role_bindings_client_stub.call_count + end + end + end + + def test_get_scope + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::Scope.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scope_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_get_scope_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_scope_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_scope({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_scope name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_scope ::Google::Cloud::GkeHub::V1::GetScopeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_scope({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_scope(::Google::Cloud::GkeHub::V1::GetScopeRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_scope_client_stub.call_count + end + end + end + + def test_create_scope + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + scope_id = "hello world" + scope = {} + + create_scope_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_create_scope_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_scope_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_scope({ parent: parent, scope_id: scope_id, scope: scope }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_scope parent: parent, scope_id: scope_id, scope: scope do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_scope ::Google::Cloud::GkeHub::V1::CreateScopeRequest.new(parent: parent, scope_id: scope_id, scope: scope) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_scope({ parent: parent, scope_id: scope_id, scope: scope }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_scope(::Google::Cloud::GkeHub::V1::CreateScopeRequest.new(parent: parent, scope_id: scope_id, scope: scope), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_scope_client_stub.call_count + end + end + end + + def test_update_scope + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + scope = {} + update_mask = {} + + update_scope_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_update_scope_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_scope_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_scope({ scope: scope, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_scope scope: scope, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_scope ::Google::Cloud::GkeHub::V1::UpdateScopeRequest.new(scope: scope, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_scope({ scope: scope, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_scope(::Google::Cloud::GkeHub::V1::UpdateScopeRequest.new(scope: scope, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_scope_client_stub.call_count + end + end + end + + def test_delete_scope + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_scope_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_delete_scope_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_scope_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_scope({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_scope name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_scope ::Google::Cloud::GkeHub::V1::DeleteScopeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_scope({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_scope(::Google::Cloud::GkeHub::V1::DeleteScopeRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_scope_client_stub.call_count + end + end + end + + def test_list_scopes + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::ListScopesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_scopes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_list_scopes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_scopes_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_scopes({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_scopes parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_scopes ::Google::Cloud::GkeHub::V1::ListScopesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_scopes({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_scopes(::Google::Cloud::GkeHub::V1::ListScopesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_scopes_client_stub.call_count + end + end + end + + def test_list_permitted_scopes + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::ListPermittedScopesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_permitted_scopes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_list_permitted_scopes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_permitted_scopes_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_permitted_scopes({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_permitted_scopes parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_permitted_scopes ::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_permitted_scopes({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_permitted_scopes(::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_permitted_scopes_client_stub.call_count + end + end + end + + def test_get_membership_binding + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::MembershipBinding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_membership_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_get_membership_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_membership_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_membership_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_membership_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_membership_binding ::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_membership_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_membership_binding(::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_membership_binding_client_stub.call_count + end + end + end + + def test_create_membership_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + membership_binding = {} + membership_binding_id = "hello world" + + create_membership_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_create_membership_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_membership_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_membership_binding({ parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_membership_binding parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_membership_binding ::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest.new(parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_membership_binding({ parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_membership_binding(::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest.new(parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_membership_binding_client_stub.call_count + end + end + end + + def test_update_membership_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + membership_binding = {} + update_mask = {} + + update_membership_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_update_membership_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_membership_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_membership_binding({ membership_binding: membership_binding, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_membership_binding membership_binding: membership_binding, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_membership_binding ::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest.new(membership_binding: membership_binding, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_membership_binding({ membership_binding: membership_binding, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_membership_binding(::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest.new(membership_binding: membership_binding, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_membership_binding_client_stub.call_count + end + end + end + + def test_delete_membership_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_membership_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_delete_membership_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_membership_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_membership_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_membership_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_membership_binding ::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_membership_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_membership_binding(::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_membership_binding_client_stub.call_count + end + end + end + + def test_list_membership_bindings + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::ListMembershipBindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_membership_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_list_membership_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_membership_bindings_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_membership_bindings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_membership_bindings parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_membership_bindings ::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_membership_bindings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_membership_bindings(::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_membership_bindings_client_stub.call_count + end + end + end + + def test_get_membership_rbac_role_binding + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::RBACRoleBinding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_membership_rbac_role_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_get_membership_rbac_role_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_membership_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_membership_rbac_role_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_membership_rbac_role_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_membership_rbac_role_binding ::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_membership_rbac_role_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_membership_rbac_role_binding(::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_membership_rbac_role_binding_client_stub.call_count + end + end + end + + def test_create_membership_rbac_role_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + rbacrolebinding_id = "hello world" + rbacrolebinding = {} + + create_membership_rbac_role_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_create_membership_rbac_role_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_membership_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_membership_rbac_role_binding({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_membership_rbac_role_binding parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_membership_rbac_role_binding ::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_membership_rbac_role_binding({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_membership_rbac_role_binding(::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_membership_rbac_role_binding_client_stub.call_count + end + end + end + + def test_update_membership_rbac_role_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + rbacrolebinding = {} + update_mask = {} + + update_membership_rbac_role_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_update_membership_rbac_role_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_membership_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_membership_rbac_role_binding({ rbacrolebinding: rbacrolebinding, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_membership_rbac_role_binding rbacrolebinding: rbacrolebinding, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_membership_rbac_role_binding ::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest.new(rbacrolebinding: rbacrolebinding, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_membership_rbac_role_binding({ rbacrolebinding: rbacrolebinding, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_membership_rbac_role_binding(::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest.new(rbacrolebinding: rbacrolebinding, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_membership_rbac_role_binding_client_stub.call_count + end + end + end + + def test_delete_membership_rbac_role_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_membership_rbac_role_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_delete_membership_rbac_role_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_membership_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_membership_rbac_role_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_membership_rbac_role_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_membership_rbac_role_binding ::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_membership_rbac_role_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_membership_rbac_role_binding(::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_membership_rbac_role_binding_client_stub.call_count + end + end + end + + def test_list_membership_rbac_role_bindings + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_membership_rbac_role_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_list_membership_rbac_role_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_membership_rbac_role_bindings_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_membership_rbac_role_bindings({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_membership_rbac_role_bindings parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_membership_rbac_role_bindings ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_membership_rbac_role_bindings({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_membership_rbac_role_bindings(::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_membership_rbac_role_bindings_client_stub.call_count + end + end + end + + def test_generate_membership_rbac_role_binding_yaml + # Create test objects. + client_result = ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + rbacrolebinding_id = "hello world" + rbacrolebinding = {} + + generate_membership_rbac_role_binding_yaml_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::GkeHub::V1::GkeHub::Rest::ServiceStub.stub :transcode_generate_membership_rbac_role_binding_yaml_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_membership_rbac_role_binding_yaml_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_membership_rbac_role_binding_yaml({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_membership_rbac_role_binding_yaml parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_membership_rbac_role_binding_yaml ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_membership_rbac_role_binding_yaml({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_membership_rbac_role_binding_yaml(::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_membership_rbac_role_binding_yaml_client_stub.call_count + end + end + end + def test_configure credentials_token = :dummy_value diff --git a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_test.rb b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_test.rb index ceee17018283..322c4edad927 100644 --- a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_test.rb +++ b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_test.rb @@ -134,6 +134,75 @@ def test_list_memberships end end + def test_list_bound_memberships + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::ListBoundMembershipsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + scope_name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_bound_memberships_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_bound_memberships, name + assert_kind_of ::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest, request + assert_equal "hello world", request["scope_name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_bound_memberships_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_bound_memberships({ scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_bound_memberships scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_bound_memberships ::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest.new(scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_bound_memberships({ scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_bound_memberships(::Google::Cloud::GkeHub::V1::ListBoundMembershipsRequest.new(scope_name: scope_name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_bound_memberships_client_stub.call_rpc_count + end + end + def test_list_features # Create GRPC objects. grpc_response = ::Google::Cloud::GkeHub::V1::ListFeaturesResponse.new @@ -147,6 +216,7 @@ def test_list_features page_token = "hello world" filter = "hello world" order_by = "hello world" + return_partial_success = true list_features_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :list_features, name @@ -156,6 +226,7 @@ def test_list_features assert_equal "hello world", request["page_token"] assert_equal "hello world", request["filter"] assert_equal "hello world", request["order_by"] + assert_equal true, request["return_partial_success"] refute_nil options end @@ -166,35 +237,35 @@ def test_list_features end # Use hash object - client.list_features({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + client.list_features({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success }) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use named arguments - client.list_features parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + client.list_features parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use protobuf object - client.list_features ::Google::Cloud::GkeHub::V1::ListFeaturesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + client.list_features ::Google::Cloud::GkeHub::V1::ListFeaturesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use hash object with options - client.list_features({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + client.list_features({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success }, grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use protobuf object with options - client.list_features(::Google::Cloud::GkeHub::V1::ListFeaturesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + client.list_features(::Google::Cloud::GkeHub::V1::ListFeaturesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, return_partial_success: return_partial_success), grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation @@ -272,11 +343,13 @@ def test_get_feature # Create request parameters for a unary method. name = "hello world" + return_partial_success = true get_feature_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :get_feature, name assert_kind_of ::Google::Cloud::GkeHub::V1::GetFeatureRequest, request assert_equal "hello world", request["name"] + assert_equal true, request["return_partial_success"] refute_nil options end @@ -287,31 +360,31 @@ def test_get_feature end # Use hash object - client.get_feature({ name: name }) do |response, operation| + client.get_feature({ name: name, return_partial_success: return_partial_success }) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use named arguments - client.get_feature name: name do |response, operation| + client.get_feature name: name, return_partial_success: return_partial_success do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object - client.get_feature ::Google::Cloud::GkeHub::V1::GetFeatureRequest.new(name: name) do |response, operation| + client.get_feature ::Google::Cloud::GkeHub::V1::GetFeatureRequest.new(name: name, return_partial_success: return_partial_success) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use hash object with options - client.get_feature({ name: name }, grpc_options) do |response, operation| + client.get_feature({ name: name, return_partial_success: return_partial_success }, grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object with options - client.get_feature(::Google::Cloud::GkeHub::V1::GetFeatureRequest.new(name: name), grpc_options) do |response, operation| + client.get_feature(::Google::Cloud::GkeHub::V1::GetFeatureRequest.new(name: name, return_partial_success: return_partial_success), grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end @@ -801,6 +874,2055 @@ def test_generate_connect_manifest end end + def test_create_fleet + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + fleet = {} + + create_fleet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_fleet, name + assert_kind_of ::Google::Cloud::GkeHub::V1::CreateFleetRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::Fleet), request["fleet"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_fleet_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_fleet({ parent: parent, fleet: fleet }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_fleet parent: parent, fleet: fleet do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_fleet ::Google::Cloud::GkeHub::V1::CreateFleetRequest.new(parent: parent, fleet: fleet) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_fleet({ parent: parent, fleet: fleet }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_fleet(::Google::Cloud::GkeHub::V1::CreateFleetRequest.new(parent: parent, fleet: fleet), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_fleet_client_stub.call_rpc_count + end + end + + def test_get_fleet + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::Fleet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_fleet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_fleet, name + assert_kind_of ::Google::Cloud::GkeHub::V1::GetFleetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_fleet_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_fleet({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_fleet name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_fleet ::Google::Cloud::GkeHub::V1::GetFleetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_fleet({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_fleet(::Google::Cloud::GkeHub::V1::GetFleetRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_fleet_client_stub.call_rpc_count + end + end + + def test_update_fleet + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + fleet = {} + update_mask = {} + + update_fleet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_fleet, name + assert_kind_of ::Google::Cloud::GkeHub::V1::UpdateFleetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::Fleet), request["fleet"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_fleet_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_fleet({ fleet: fleet, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_fleet fleet: fleet, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_fleet ::Google::Cloud::GkeHub::V1::UpdateFleetRequest.new(fleet: fleet, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_fleet({ fleet: fleet, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_fleet(::Google::Cloud::GkeHub::V1::UpdateFleetRequest.new(fleet: fleet, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_fleet_client_stub.call_rpc_count + end + end + + def test_delete_fleet + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_fleet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_fleet, name + assert_kind_of ::Google::Cloud::GkeHub::V1::DeleteFleetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_fleet_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_fleet({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_fleet name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_fleet ::Google::Cloud::GkeHub::V1::DeleteFleetRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_fleet({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_fleet(::Google::Cloud::GkeHub::V1::DeleteFleetRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_fleet_client_stub.call_rpc_count + end + end + + def test_list_fleets + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::ListFleetsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_fleets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_fleets, name + assert_kind_of ::Google::Cloud::GkeHub::V1::ListFleetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_fleets_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_fleets({ parent: parent, page_token: page_token, page_size: page_size }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_fleets parent: parent, page_token: page_token, page_size: page_size do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_fleets ::Google::Cloud::GkeHub::V1::ListFleetsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_fleets({ parent: parent, page_token: page_token, page_size: page_size }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_fleets(::Google::Cloud::GkeHub::V1::ListFleetsRequest.new(parent: parent, page_token: page_token, page_size: page_size), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_fleets_client_stub.call_rpc_count + end + end + + def test_get_scope_namespace + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::Namespace.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scope_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_scope_namespace, name + assert_kind_of ::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_scope_namespace_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_scope_namespace({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_scope_namespace name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_scope_namespace ::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_scope_namespace({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_scope_namespace(::Google::Cloud::GkeHub::V1::GetScopeNamespaceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_scope_namespace_client_stub.call_rpc_count + end + end + + def test_create_scope_namespace + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + scope_namespace_id = "hello world" + scope_namespace = {} + + create_scope_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_scope_namespace, name + assert_kind_of ::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["scope_namespace_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::Namespace), request["scope_namespace"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_scope_namespace_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_scope_namespace({ parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_scope_namespace parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_scope_namespace ::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest.new(parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_scope_namespace({ parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_scope_namespace(::Google::Cloud::GkeHub::V1::CreateScopeNamespaceRequest.new(parent: parent, scope_namespace_id: scope_namespace_id, scope_namespace: scope_namespace), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_scope_namespace_client_stub.call_rpc_count + end + end + + def test_update_scope_namespace + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + scope_namespace = {} + update_mask = {} + + update_scope_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_scope_namespace, name + assert_kind_of ::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::Namespace), request["scope_namespace"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_scope_namespace_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_scope_namespace({ scope_namespace: scope_namespace, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_scope_namespace scope_namespace: scope_namespace, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_scope_namespace ::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest.new(scope_namespace: scope_namespace, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_scope_namespace({ scope_namespace: scope_namespace, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_scope_namespace(::Google::Cloud::GkeHub::V1::UpdateScopeNamespaceRequest.new(scope_namespace: scope_namespace, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_scope_namespace_client_stub.call_rpc_count + end + end + + def test_delete_scope_namespace + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_scope_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_scope_namespace, name + assert_kind_of ::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_scope_namespace_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_scope_namespace({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_scope_namespace name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_scope_namespace ::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_scope_namespace({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_scope_namespace(::Google::Cloud::GkeHub::V1::DeleteScopeNamespaceRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_scope_namespace_client_stub.call_rpc_count + end + end + + def test_list_scope_namespaces + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::ListScopeNamespacesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_scope_namespaces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_scope_namespaces, name + assert_kind_of ::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_scope_namespaces_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_scope_namespaces({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_scope_namespaces parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_scope_namespaces ::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_scope_namespaces({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_scope_namespaces(::Google::Cloud::GkeHub::V1::ListScopeNamespacesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_scope_namespaces_client_stub.call_rpc_count + end + end + + def test_get_scope_rbac_role_binding + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::RBACRoleBinding.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scope_rbac_role_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_scope_rbac_role_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_scope_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_scope_rbac_role_binding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_scope_rbac_role_binding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_scope_rbac_role_binding ::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_scope_rbac_role_binding({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_scope_rbac_role_binding(::Google::Cloud::GkeHub::V1::GetScopeRBACRoleBindingRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_scope_rbac_role_binding_client_stub.call_rpc_count + end + end + + def test_create_scope_rbac_role_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + rbacrolebinding_id = "hello world" + rbacrolebinding = {} + + create_scope_rbac_role_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_scope_rbac_role_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["rbacrolebinding_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::RBACRoleBinding), request["rbacrolebinding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_scope_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_scope_rbac_role_binding({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_scope_rbac_role_binding parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_scope_rbac_role_binding ::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_scope_rbac_role_binding({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_scope_rbac_role_binding(::Google::Cloud::GkeHub::V1::CreateScopeRBACRoleBindingRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_scope_rbac_role_binding_client_stub.call_rpc_count + end + end + + def test_update_scope_rbac_role_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + rbacrolebinding = {} + update_mask = {} + + update_scope_rbac_role_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_scope_rbac_role_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::RBACRoleBinding), request["rbacrolebinding"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_scope_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_scope_rbac_role_binding({ rbacrolebinding: rbacrolebinding, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_scope_rbac_role_binding rbacrolebinding: rbacrolebinding, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_scope_rbac_role_binding ::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest.new(rbacrolebinding: rbacrolebinding, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_scope_rbac_role_binding({ rbacrolebinding: rbacrolebinding, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_scope_rbac_role_binding(::Google::Cloud::GkeHub::V1::UpdateScopeRBACRoleBindingRequest.new(rbacrolebinding: rbacrolebinding, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_scope_rbac_role_binding_client_stub.call_rpc_count + end + end + + def test_delete_scope_rbac_role_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_scope_rbac_role_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_scope_rbac_role_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_scope_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_scope_rbac_role_binding({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_scope_rbac_role_binding name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_scope_rbac_role_binding ::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_scope_rbac_role_binding({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_scope_rbac_role_binding(::Google::Cloud::GkeHub::V1::DeleteScopeRBACRoleBindingRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_scope_rbac_role_binding_client_stub.call_rpc_count + end + end + + def test_list_scope_rbac_role_bindings + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_scope_rbac_role_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_scope_rbac_role_bindings, name + assert_kind_of ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_scope_rbac_role_bindings_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_scope_rbac_role_bindings({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_scope_rbac_role_bindings parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_scope_rbac_role_bindings ::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_scope_rbac_role_bindings({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_scope_rbac_role_bindings(::Google::Cloud::GkeHub::V1::ListScopeRBACRoleBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_scope_rbac_role_bindings_client_stub.call_rpc_count + end + end + + def test_get_scope + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::Scope.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scope_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_scope, name + assert_kind_of ::Google::Cloud::GkeHub::V1::GetScopeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_scope_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_scope({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_scope name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_scope ::Google::Cloud::GkeHub::V1::GetScopeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_scope({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_scope(::Google::Cloud::GkeHub::V1::GetScopeRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_scope_client_stub.call_rpc_count + end + end + + def test_create_scope + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + scope_id = "hello world" + scope = {} + + create_scope_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_scope, name + assert_kind_of ::Google::Cloud::GkeHub::V1::CreateScopeRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["scope_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::Scope), request["scope"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_scope_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_scope({ parent: parent, scope_id: scope_id, scope: scope }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_scope parent: parent, scope_id: scope_id, scope: scope do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_scope ::Google::Cloud::GkeHub::V1::CreateScopeRequest.new(parent: parent, scope_id: scope_id, scope: scope) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_scope({ parent: parent, scope_id: scope_id, scope: scope }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_scope(::Google::Cloud::GkeHub::V1::CreateScopeRequest.new(parent: parent, scope_id: scope_id, scope: scope), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_scope_client_stub.call_rpc_count + end + end + + def test_update_scope + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + scope = {} + update_mask = {} + + update_scope_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_scope, name + assert_kind_of ::Google::Cloud::GkeHub::V1::UpdateScopeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::Scope), request["scope"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_scope_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_scope({ scope: scope, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_scope scope: scope, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_scope ::Google::Cloud::GkeHub::V1::UpdateScopeRequest.new(scope: scope, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_scope({ scope: scope, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_scope(::Google::Cloud::GkeHub::V1::UpdateScopeRequest.new(scope: scope, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_scope_client_stub.call_rpc_count + end + end + + def test_delete_scope + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_scope_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_scope, name + assert_kind_of ::Google::Cloud::GkeHub::V1::DeleteScopeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_scope_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_scope({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_scope name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_scope ::Google::Cloud::GkeHub::V1::DeleteScopeRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_scope({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_scope(::Google::Cloud::GkeHub::V1::DeleteScopeRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_scope_client_stub.call_rpc_count + end + end + + def test_list_scopes + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::ListScopesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_scopes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_scopes, name + assert_kind_of ::Google::Cloud::GkeHub::V1::ListScopesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_scopes_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_scopes({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_scopes parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_scopes ::Google::Cloud::GkeHub::V1::ListScopesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_scopes({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_scopes(::Google::Cloud::GkeHub::V1::ListScopesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_scopes_client_stub.call_rpc_count + end + end + + def test_list_permitted_scopes + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::ListPermittedScopesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_permitted_scopes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_permitted_scopes, name + assert_kind_of ::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_permitted_scopes_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_permitted_scopes({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_permitted_scopes parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_permitted_scopes ::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_permitted_scopes({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_permitted_scopes(::Google::Cloud::GkeHub::V1::ListPermittedScopesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_permitted_scopes_client_stub.call_rpc_count + end + end + + def test_get_membership_binding + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::MembershipBinding.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_membership_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_membership_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_membership_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_membership_binding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_membership_binding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_membership_binding ::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_membership_binding({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_membership_binding(::Google::Cloud::GkeHub::V1::GetMembershipBindingRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_membership_binding_client_stub.call_rpc_count + end + end + + def test_create_membership_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + membership_binding = {} + membership_binding_id = "hello world" + + create_membership_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_membership_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::MembershipBinding), request["membership_binding"] + assert_equal "hello world", request["membership_binding_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_membership_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_membership_binding({ parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_membership_binding parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_membership_binding ::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest.new(parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_membership_binding({ parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_membership_binding(::Google::Cloud::GkeHub::V1::CreateMembershipBindingRequest.new(parent: parent, membership_binding: membership_binding, membership_binding_id: membership_binding_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_membership_binding_client_stub.call_rpc_count + end + end + + def test_update_membership_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + membership_binding = {} + update_mask = {} + + update_membership_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_membership_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::MembershipBinding), request["membership_binding"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_membership_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_membership_binding({ membership_binding: membership_binding, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_membership_binding membership_binding: membership_binding, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_membership_binding ::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest.new(membership_binding: membership_binding, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_membership_binding({ membership_binding: membership_binding, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_membership_binding(::Google::Cloud::GkeHub::V1::UpdateMembershipBindingRequest.new(membership_binding: membership_binding, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_membership_binding_client_stub.call_rpc_count + end + end + + def test_delete_membership_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_membership_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_membership_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_membership_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_membership_binding({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_membership_binding name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_membership_binding ::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_membership_binding({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_membership_binding(::Google::Cloud::GkeHub::V1::DeleteMembershipBindingRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_membership_binding_client_stub.call_rpc_count + end + end + + def test_list_membership_bindings + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::ListMembershipBindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_membership_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_membership_bindings, name + assert_kind_of ::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_membership_bindings_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_membership_bindings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_membership_bindings parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_membership_bindings ::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_membership_bindings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_membership_bindings(::Google::Cloud::GkeHub::V1::ListMembershipBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_membership_bindings_client_stub.call_rpc_count + end + end + + def test_get_membership_rbac_role_binding + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::RBACRoleBinding.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_membership_rbac_role_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_membership_rbac_role_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_membership_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_membership_rbac_role_binding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_membership_rbac_role_binding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_membership_rbac_role_binding ::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_membership_rbac_role_binding({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_membership_rbac_role_binding(::Google::Cloud::GkeHub::V1::GetMembershipRBACRoleBindingRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_membership_rbac_role_binding_client_stub.call_rpc_count + end + end + + def test_create_membership_rbac_role_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + rbacrolebinding_id = "hello world" + rbacrolebinding = {} + + create_membership_rbac_role_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_membership_rbac_role_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["rbacrolebinding_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::RBACRoleBinding), request["rbacrolebinding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_membership_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_membership_rbac_role_binding({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_membership_rbac_role_binding parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_membership_rbac_role_binding ::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_membership_rbac_role_binding({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_membership_rbac_role_binding(::Google::Cloud::GkeHub::V1::CreateMembershipRBACRoleBindingRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_membership_rbac_role_binding_client_stub.call_rpc_count + end + end + + def test_update_membership_rbac_role_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + rbacrolebinding = {} + update_mask = {} + + update_membership_rbac_role_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_membership_rbac_role_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::RBACRoleBinding), request["rbacrolebinding"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_membership_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_membership_rbac_role_binding({ rbacrolebinding: rbacrolebinding, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_membership_rbac_role_binding rbacrolebinding: rbacrolebinding, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_membership_rbac_role_binding ::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest.new(rbacrolebinding: rbacrolebinding, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_membership_rbac_role_binding({ rbacrolebinding: rbacrolebinding, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_membership_rbac_role_binding(::Google::Cloud::GkeHub::V1::UpdateMembershipRBACRoleBindingRequest.new(rbacrolebinding: rbacrolebinding, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_membership_rbac_role_binding_client_stub.call_rpc_count + end + end + + def test_delete_membership_rbac_role_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_membership_rbac_role_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_membership_rbac_role_binding, name + assert_kind_of ::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_membership_rbac_role_binding_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_membership_rbac_role_binding({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_membership_rbac_role_binding name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_membership_rbac_role_binding ::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_membership_rbac_role_binding({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_membership_rbac_role_binding(::Google::Cloud::GkeHub::V1::DeleteMembershipRBACRoleBindingRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_membership_rbac_role_binding_client_stub.call_rpc_count + end + end + + def test_list_membership_rbac_role_bindings + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_membership_rbac_role_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_membership_rbac_role_bindings, name + assert_kind_of ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_membership_rbac_role_bindings_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_membership_rbac_role_bindings({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_membership_rbac_role_bindings parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_membership_rbac_role_bindings ::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_membership_rbac_role_bindings({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_membership_rbac_role_bindings(::Google::Cloud::GkeHub::V1::ListMembershipRBACRoleBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_membership_rbac_role_bindings_client_stub.call_rpc_count + end + end + + def test_generate_membership_rbac_role_binding_yaml + # Create GRPC objects. + grpc_response = ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + rbacrolebinding_id = "hello world" + rbacrolebinding = {} + + generate_membership_rbac_role_binding_yaml_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_membership_rbac_role_binding_yaml, name + assert_kind_of ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["rbacrolebinding_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::GkeHub::V1::RBACRoleBinding), request["rbacrolebinding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_membership_rbac_role_binding_yaml_client_stub do + # Create client + client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_membership_rbac_role_binding_yaml({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_membership_rbac_role_binding_yaml parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_membership_rbac_role_binding_yaml ::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_membership_rbac_role_binding_yaml({ parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_membership_rbac_role_binding_yaml(::Google::Cloud::GkeHub::V1::GenerateMembershipRBACRoleBindingYAMLRequest.new(parent: parent, rbacrolebinding_id: rbacrolebinding_id, rbacrolebinding: rbacrolebinding), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_membership_rbac_role_binding_yaml_client_stub.call_rpc_count + end + end + def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure