google-cloud-redis-cluster-v1beta1 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2461,6 +2461,802 @@ module Google
2461
2461
  raise ::Google::Cloud::Error.from_error(e)
2462
2462
  end
2463
2463
 
2464
+ ##
2465
+ # Lists all the token auth users for a token based auth enabled cluster.
2466
+ #
2467
+ # @overload list_token_auth_users(request, options = nil)
2468
+ # Pass arguments to `list_token_auth_users` via a request object, either of type
2469
+ # {::Google::Cloud::Redis::Cluster::V1beta1::ListTokenAuthUsersRequest} or an equivalent Hash.
2470
+ #
2471
+ # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListTokenAuthUsersRequest, ::Hash]
2472
+ # A request object representing the call parameters. Required. To specify no
2473
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2474
+ # @param options [::Gapic::CallOptions, ::Hash]
2475
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2476
+ #
2477
+ # @overload list_token_auth_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2478
+ # Pass arguments to `list_token_auth_users` via keyword arguments. Note that at
2479
+ # least one keyword argument is required. To specify no parameters, or to keep all
2480
+ # the default parameter values, pass an empty Hash as a request object (see above).
2481
+ #
2482
+ # @param parent [::String]
2483
+ # Required. The parent resource that this token based auth user will be
2484
+ # listed for. Format:
2485
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}
2486
+ # @param page_size [::Integer]
2487
+ # Optional. The maximum number of items to return.
2488
+ #
2489
+ # If not specified, a default value of 1000 will be used by the service.
2490
+ # Regardless of the page_size value, the response may include a partial list
2491
+ # and a caller should only rely on response's
2492
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2493
+ # {::Google::Cloud::Redis::Cluster::V1beta1::ListTokenAuthUsersResponse#next_page_token `next_page_token`}
2494
+ # to determine if there are more clusters left to be queried.
2495
+ # @param page_token [::String]
2496
+ # Optional. The `next_page_token` value returned from a previous
2497
+ # [ListTokenAuthUsers] request, if any.
2498
+ # @param filter [::String]
2499
+ # Optional. Expression for filtering results.
2500
+ # @param order_by [::String]
2501
+ # Optional. Sort results by a defined order.
2502
+ #
2503
+ # @yield [response, operation] Access the result along with the RPC operation
2504
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::TokenAuthUser>]
2505
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2506
+ #
2507
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::TokenAuthUser>]
2508
+ #
2509
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2510
+ #
2511
+ # @example Basic example
2512
+ # require "google/cloud/redis/cluster/v1beta1"
2513
+ #
2514
+ # # Create a client object. The client can be reused for multiple calls.
2515
+ # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
2516
+ #
2517
+ # # Create a request. To set request fields, pass in keyword arguments.
2518
+ # request = Google::Cloud::Redis::Cluster::V1beta1::ListTokenAuthUsersRequest.new
2519
+ #
2520
+ # # Call the list_token_auth_users method.
2521
+ # result = client.list_token_auth_users request
2522
+ #
2523
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2524
+ # # over elements, and API calls will be issued to fetch pages as needed.
2525
+ # result.each do |item|
2526
+ # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::TokenAuthUser.
2527
+ # p item
2528
+ # end
2529
+ #
2530
+ def list_token_auth_users request, options = nil
2531
+ raise ::ArgumentError, "request must be provided" if request.nil?
2532
+
2533
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListTokenAuthUsersRequest
2534
+
2535
+ # Converts hash and nil to an options object
2536
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2537
+
2538
+ # Customize the options with defaults
2539
+ metadata = @config.rpcs.list_token_auth_users.metadata.to_h
2540
+
2541
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2542
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2543
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2544
+ gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
2545
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2546
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2547
+
2548
+ header_params = {}
2549
+ if request.parent
2550
+ header_params["parent"] = request.parent
2551
+ end
2552
+
2553
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2554
+ metadata[:"x-goog-request-params"] ||= request_params_header
2555
+
2556
+ options.apply_defaults timeout: @config.rpcs.list_token_auth_users.timeout,
2557
+ metadata: metadata,
2558
+ retry_policy: @config.rpcs.list_token_auth_users.retry_policy
2559
+
2560
+ options.apply_defaults timeout: @config.timeout,
2561
+ metadata: @config.metadata,
2562
+ retry_policy: @config.retry_policy
2563
+
2564
+ @cloud_redis_cluster_stub.call_rpc :list_token_auth_users, request, options: options do |response, operation|
2565
+ response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_token_auth_users, request, response, operation, options
2566
+ yield response, operation if block_given?
2567
+ throw :response, response
2568
+ end
2569
+ rescue ::GRPC::BadStatus => e
2570
+ raise ::Google::Cloud::Error.from_error(e)
2571
+ end
2572
+
2573
+ ##
2574
+ # Gets a specific token auth user for a basic auth enabled cluster.
2575
+ #
2576
+ # @overload get_token_auth_user(request, options = nil)
2577
+ # Pass arguments to `get_token_auth_user` via a request object, either of type
2578
+ # {::Google::Cloud::Redis::Cluster::V1beta1::GetTokenAuthUserRequest} or an equivalent Hash.
2579
+ #
2580
+ # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetTokenAuthUserRequest, ::Hash]
2581
+ # A request object representing the call parameters. Required. To specify no
2582
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2583
+ # @param options [::Gapic::CallOptions, ::Hash]
2584
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2585
+ #
2586
+ # @overload get_token_auth_user(name: nil)
2587
+ # Pass arguments to `get_token_auth_user` via keyword arguments. Note that at
2588
+ # least one keyword argument is required. To specify no parameters, or to keep all
2589
+ # the default parameter values, pass an empty Hash as a request object (see above).
2590
+ #
2591
+ # @param name [::String]
2592
+ # Required. The name of token auth user for a token based auth enabled
2593
+ # cluster. Format:
2594
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/tokenAuthUsers/\\{token_auth_user}
2595
+ #
2596
+ # @yield [response, operation] Access the result along with the RPC operation
2597
+ # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::TokenAuthUser]
2598
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2599
+ #
2600
+ # @return [::Google::Cloud::Redis::Cluster::V1beta1::TokenAuthUser]
2601
+ #
2602
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2603
+ #
2604
+ # @example Basic example
2605
+ # require "google/cloud/redis/cluster/v1beta1"
2606
+ #
2607
+ # # Create a client object. The client can be reused for multiple calls.
2608
+ # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
2609
+ #
2610
+ # # Create a request. To set request fields, pass in keyword arguments.
2611
+ # request = Google::Cloud::Redis::Cluster::V1beta1::GetTokenAuthUserRequest.new
2612
+ #
2613
+ # # Call the get_token_auth_user method.
2614
+ # result = client.get_token_auth_user request
2615
+ #
2616
+ # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::TokenAuthUser.
2617
+ # p result
2618
+ #
2619
+ def get_token_auth_user request, options = nil
2620
+ raise ::ArgumentError, "request must be provided" if request.nil?
2621
+
2622
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetTokenAuthUserRequest
2623
+
2624
+ # Converts hash and nil to an options object
2625
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2626
+
2627
+ # Customize the options with defaults
2628
+ metadata = @config.rpcs.get_token_auth_user.metadata.to_h
2629
+
2630
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2631
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2632
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2633
+ gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
2634
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2635
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2636
+
2637
+ header_params = {}
2638
+ if request.name
2639
+ header_params["name"] = request.name
2640
+ end
2641
+
2642
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2643
+ metadata[:"x-goog-request-params"] ||= request_params_header
2644
+
2645
+ options.apply_defaults timeout: @config.rpcs.get_token_auth_user.timeout,
2646
+ metadata: metadata,
2647
+ retry_policy: @config.rpcs.get_token_auth_user.retry_policy
2648
+
2649
+ options.apply_defaults timeout: @config.timeout,
2650
+ metadata: @config.metadata,
2651
+ retry_policy: @config.retry_policy
2652
+
2653
+ @cloud_redis_cluster_stub.call_rpc :get_token_auth_user, request, options: options do |response, operation|
2654
+ yield response, operation if block_given?
2655
+ end
2656
+ rescue ::GRPC::BadStatus => e
2657
+ raise ::Google::Cloud::Error.from_error(e)
2658
+ end
2659
+
2660
+ ##
2661
+ # Lists all the auth tokens for a specific token auth user.
2662
+ #
2663
+ # @overload list_auth_tokens(request, options = nil)
2664
+ # Pass arguments to `list_auth_tokens` via a request object, either of type
2665
+ # {::Google::Cloud::Redis::Cluster::V1beta1::ListAuthTokensRequest} or an equivalent Hash.
2666
+ #
2667
+ # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListAuthTokensRequest, ::Hash]
2668
+ # A request object representing the call parameters. Required. To specify no
2669
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2670
+ # @param options [::Gapic::CallOptions, ::Hash]
2671
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2672
+ #
2673
+ # @overload list_auth_tokens(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2674
+ # Pass arguments to `list_auth_tokens` via keyword arguments. Note that at
2675
+ # least one keyword argument is required. To specify no parameters, or to keep all
2676
+ # the default parameter values, pass an empty Hash as a request object (see above).
2677
+ #
2678
+ # @param parent [::String]
2679
+ # Required. The parent resource that this auth token will be listed for.
2680
+ # Format:
2681
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/tokenAuthUsers/\\{token_auth_user}
2682
+ # @param page_size [::Integer]
2683
+ # Optional. The maximum number of items to return. The maximum value is 1000;
2684
+ # values above 1000 will be coerced to 1000. If not specified, a default
2685
+ # value of 1000 will be used by the service. Regardless of the page_size
2686
+ # value, the response may include a partial list and a caller should only
2687
+ # rely on response's
2688
+ # {::Google::Cloud::Redis::Cluster::V1beta1::ListTokenAuthUsersResponse#next_page_token `next_page_token`}
2689
+ # to determine if there are more clusters left to be queried.
2690
+ # @param page_token [::String]
2691
+ # Optional. The `next_page_token` value returned from a previous
2692
+ # [ListTokenAuthUsers] request, if any.
2693
+ # @param filter [::String]
2694
+ # Optional. Expression for filtering results.
2695
+ # @param order_by [::String]
2696
+ # Optional. Sort results by a defined order.
2697
+ #
2698
+ # @yield [response, operation] Access the result along with the RPC operation
2699
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::AuthToken>]
2700
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2701
+ #
2702
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::AuthToken>]
2703
+ #
2704
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2705
+ #
2706
+ # @example Basic example
2707
+ # require "google/cloud/redis/cluster/v1beta1"
2708
+ #
2709
+ # # Create a client object. The client can be reused for multiple calls.
2710
+ # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
2711
+ #
2712
+ # # Create a request. To set request fields, pass in keyword arguments.
2713
+ # request = Google::Cloud::Redis::Cluster::V1beta1::ListAuthTokensRequest.new
2714
+ #
2715
+ # # Call the list_auth_tokens method.
2716
+ # result = client.list_auth_tokens request
2717
+ #
2718
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2719
+ # # over elements, and API calls will be issued to fetch pages as needed.
2720
+ # result.each do |item|
2721
+ # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::AuthToken.
2722
+ # p item
2723
+ # end
2724
+ #
2725
+ def list_auth_tokens request, options = nil
2726
+ raise ::ArgumentError, "request must be provided" if request.nil?
2727
+
2728
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListAuthTokensRequest
2729
+
2730
+ # Converts hash and nil to an options object
2731
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2732
+
2733
+ # Customize the options with defaults
2734
+ metadata = @config.rpcs.list_auth_tokens.metadata.to_h
2735
+
2736
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2737
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2738
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2739
+ gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
2740
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2741
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2742
+
2743
+ header_params = {}
2744
+ if request.parent
2745
+ header_params["parent"] = request.parent
2746
+ end
2747
+
2748
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2749
+ metadata[:"x-goog-request-params"] ||= request_params_header
2750
+
2751
+ options.apply_defaults timeout: @config.rpcs.list_auth_tokens.timeout,
2752
+ metadata: metadata,
2753
+ retry_policy: @config.rpcs.list_auth_tokens.retry_policy
2754
+
2755
+ options.apply_defaults timeout: @config.timeout,
2756
+ metadata: @config.metadata,
2757
+ retry_policy: @config.retry_policy
2758
+
2759
+ @cloud_redis_cluster_stub.call_rpc :list_auth_tokens, request, options: options do |response, operation|
2760
+ response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_auth_tokens, request, response, operation, options
2761
+ yield response, operation if block_given?
2762
+ throw :response, response
2763
+ end
2764
+ rescue ::GRPC::BadStatus => e
2765
+ raise ::Google::Cloud::Error.from_error(e)
2766
+ end
2767
+
2768
+ ##
2769
+ # Gets a specific auth token for a specific token auth user.
2770
+ #
2771
+ # @overload get_auth_token(request, options = nil)
2772
+ # Pass arguments to `get_auth_token` via a request object, either of type
2773
+ # {::Google::Cloud::Redis::Cluster::V1beta1::GetAuthTokenRequest} or an equivalent Hash.
2774
+ #
2775
+ # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetAuthTokenRequest, ::Hash]
2776
+ # A request object representing the call parameters. Required. To specify no
2777
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2778
+ # @param options [::Gapic::CallOptions, ::Hash]
2779
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2780
+ #
2781
+ # @overload get_auth_token(name: nil)
2782
+ # Pass arguments to `get_auth_token` via keyword arguments. Note that at
2783
+ # least one keyword argument is required. To specify no parameters, or to keep all
2784
+ # the default parameter values, pass an empty Hash as a request object (see above).
2785
+ #
2786
+ # @param name [::String]
2787
+ # Required. The name of auth token for a token based auth enabled cluster.
2788
+ # Format:
2789
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{auth_token}
2790
+ #
2791
+ # @yield [response, operation] Access the result along with the RPC operation
2792
+ # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::AuthToken]
2793
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2794
+ #
2795
+ # @return [::Google::Cloud::Redis::Cluster::V1beta1::AuthToken]
2796
+ #
2797
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2798
+ #
2799
+ # @example Basic example
2800
+ # require "google/cloud/redis/cluster/v1beta1"
2801
+ #
2802
+ # # Create a client object. The client can be reused for multiple calls.
2803
+ # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
2804
+ #
2805
+ # # Create a request. To set request fields, pass in keyword arguments.
2806
+ # request = Google::Cloud::Redis::Cluster::V1beta1::GetAuthTokenRequest.new
2807
+ #
2808
+ # # Call the get_auth_token method.
2809
+ # result = client.get_auth_token request
2810
+ #
2811
+ # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::AuthToken.
2812
+ # p result
2813
+ #
2814
+ def get_auth_token request, options = nil
2815
+ raise ::ArgumentError, "request must be provided" if request.nil?
2816
+
2817
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetAuthTokenRequest
2818
+
2819
+ # Converts hash and nil to an options object
2820
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2821
+
2822
+ # Customize the options with defaults
2823
+ metadata = @config.rpcs.get_auth_token.metadata.to_h
2824
+
2825
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2826
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2827
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2828
+ gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
2829
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2830
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2831
+
2832
+ header_params = {}
2833
+ if request.name
2834
+ header_params["name"] = request.name
2835
+ end
2836
+
2837
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2838
+ metadata[:"x-goog-request-params"] ||= request_params_header
2839
+
2840
+ options.apply_defaults timeout: @config.rpcs.get_auth_token.timeout,
2841
+ metadata: metadata,
2842
+ retry_policy: @config.rpcs.get_auth_token.retry_policy
2843
+
2844
+ options.apply_defaults timeout: @config.timeout,
2845
+ metadata: @config.metadata,
2846
+ retry_policy: @config.retry_policy
2847
+
2848
+ @cloud_redis_cluster_stub.call_rpc :get_auth_token, request, options: options do |response, operation|
2849
+ yield response, operation if block_given?
2850
+ end
2851
+ rescue ::GRPC::BadStatus => e
2852
+ raise ::Google::Cloud::Error.from_error(e)
2853
+ end
2854
+
2855
+ ##
2856
+ # Adds a token auth user for a token based auth enabled cluster.
2857
+ #
2858
+ # @overload add_token_auth_user(request, options = nil)
2859
+ # Pass arguments to `add_token_auth_user` via a request object, either of type
2860
+ # {::Google::Cloud::Redis::Cluster::V1beta1::AddTokenAuthUserRequest} or an equivalent Hash.
2861
+ #
2862
+ # @param request [::Google::Cloud::Redis::Cluster::V1beta1::AddTokenAuthUserRequest, ::Hash]
2863
+ # A request object representing the call parameters. Required. To specify no
2864
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2865
+ # @param options [::Gapic::CallOptions, ::Hash]
2866
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2867
+ #
2868
+ # @overload add_token_auth_user(cluster: nil, token_auth_user: nil)
2869
+ # Pass arguments to `add_token_auth_user` via keyword arguments. Note that at
2870
+ # least one keyword argument is required. To specify no parameters, or to keep all
2871
+ # the default parameter values, pass an empty Hash as a request object (see above).
2872
+ #
2873
+ # @param cluster [::String]
2874
+ # Required. The cluster resource that this token auth user will be added for.
2875
+ # Format: projects/\\{project}/locations/\\{location}/clusters/\\{cluster}
2876
+ # @param token_auth_user [::String]
2877
+ # Required. The id of the token auth user to add.
2878
+ #
2879
+ # @yield [response, operation] Access the result along with the RPC operation
2880
+ # @yieldparam response [::Gapic::Operation]
2881
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2882
+ #
2883
+ # @return [::Gapic::Operation]
2884
+ #
2885
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2886
+ #
2887
+ # @example Basic example
2888
+ # require "google/cloud/redis/cluster/v1beta1"
2889
+ #
2890
+ # # Create a client object. The client can be reused for multiple calls.
2891
+ # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
2892
+ #
2893
+ # # Create a request. To set request fields, pass in keyword arguments.
2894
+ # request = Google::Cloud::Redis::Cluster::V1beta1::AddTokenAuthUserRequest.new
2895
+ #
2896
+ # # Call the add_token_auth_user method.
2897
+ # result = client.add_token_auth_user request
2898
+ #
2899
+ # # The returned object is of type Gapic::Operation. You can use it to
2900
+ # # check the status of an operation, cancel it, or wait for results.
2901
+ # # Here is how to wait for a response.
2902
+ # result.wait_until_done! timeout: 60
2903
+ # if result.response?
2904
+ # p result.response
2905
+ # else
2906
+ # puts "No response received."
2907
+ # end
2908
+ #
2909
+ def add_token_auth_user request, options = nil
2910
+ raise ::ArgumentError, "request must be provided" if request.nil?
2911
+
2912
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::AddTokenAuthUserRequest
2913
+
2914
+ # Converts hash and nil to an options object
2915
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2916
+
2917
+ # Customize the options with defaults
2918
+ metadata = @config.rpcs.add_token_auth_user.metadata.to_h
2919
+
2920
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2921
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2922
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2923
+ gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
2924
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2925
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2926
+
2927
+ header_params = {}
2928
+ if request.cluster
2929
+ header_params["cluster"] = request.cluster
2930
+ end
2931
+
2932
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2933
+ metadata[:"x-goog-request-params"] ||= request_params_header
2934
+
2935
+ options.apply_defaults timeout: @config.rpcs.add_token_auth_user.timeout,
2936
+ metadata: metadata,
2937
+ retry_policy: @config.rpcs.add_token_auth_user.retry_policy
2938
+
2939
+ options.apply_defaults timeout: @config.timeout,
2940
+ metadata: @config.metadata,
2941
+ retry_policy: @config.retry_policy
2942
+
2943
+ @cloud_redis_cluster_stub.call_rpc :add_token_auth_user, request, options: options do |response, operation|
2944
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2945
+ yield response, operation if block_given?
2946
+ throw :response, response
2947
+ end
2948
+ rescue ::GRPC::BadStatus => e
2949
+ raise ::Google::Cloud::Error.from_error(e)
2950
+ end
2951
+
2952
+ ##
2953
+ # Deletes a token auth user for a token based auth enabled cluster.
2954
+ #
2955
+ # @overload delete_token_auth_user(request, options = nil)
2956
+ # Pass arguments to `delete_token_auth_user` via a request object, either of type
2957
+ # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteTokenAuthUserRequest} or an equivalent Hash.
2958
+ #
2959
+ # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteTokenAuthUserRequest, ::Hash]
2960
+ # A request object representing the call parameters. Required. To specify no
2961
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2962
+ # @param options [::Gapic::CallOptions, ::Hash]
2963
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2964
+ #
2965
+ # @overload delete_token_auth_user(name: nil, request_id: nil, force: nil)
2966
+ # Pass arguments to `delete_token_auth_user` via keyword arguments. Note that at
2967
+ # least one keyword argument is required. To specify no parameters, or to keep all
2968
+ # the default parameter values, pass an empty Hash as a request object (see above).
2969
+ #
2970
+ # @param name [::String]
2971
+ # Required. The name of the token auth user to delete.
2972
+ # Format:
2973
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/tokenAuthUsers/\\{token_auth_user}
2974
+ # @param request_id [::String]
2975
+ # Optional. An optional request ID to identify requests. Specify a unique
2976
+ # request ID so that if you must retry your request, the server will know to
2977
+ # ignore the request if it has already been completed. The server will
2978
+ # guarantee that for at least 60 minutes after the first request.
2979
+ #
2980
+ # For example, consider a situation where you make an initial request and the
2981
+ # request times out. If you make the request again with the same request
2982
+ # ID, the server can check if original operation with the same request ID
2983
+ # was received, and if so, will ignore the second request. This prevents
2984
+ # clients from accidentally creating duplicate commitments.
2985
+ #
2986
+ # The request ID must be a valid UUID with the exception that zero UUID is
2987
+ # not supported (00000000-0000-0000-0000-000000000000).
2988
+ # @param force [::Boolean]
2989
+ # Optional. If set to true, any child auth tokens of this user will also be
2990
+ # deleted. Otherwise, the request will only work if the user has no auth
2991
+ # tokens.
2992
+ #
2993
+ # @yield [response, operation] Access the result along with the RPC operation
2994
+ # @yieldparam response [::Gapic::Operation]
2995
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2996
+ #
2997
+ # @return [::Gapic::Operation]
2998
+ #
2999
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3000
+ #
3001
+ # @example Basic example
3002
+ # require "google/cloud/redis/cluster/v1beta1"
3003
+ #
3004
+ # # Create a client object. The client can be reused for multiple calls.
3005
+ # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
3006
+ #
3007
+ # # Create a request. To set request fields, pass in keyword arguments.
3008
+ # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteTokenAuthUserRequest.new
3009
+ #
3010
+ # # Call the delete_token_auth_user method.
3011
+ # result = client.delete_token_auth_user request
3012
+ #
3013
+ # # The returned object is of type Gapic::Operation. You can use it to
3014
+ # # check the status of an operation, cancel it, or wait for results.
3015
+ # # Here is how to wait for a response.
3016
+ # result.wait_until_done! timeout: 60
3017
+ # if result.response?
3018
+ # p result.response
3019
+ # else
3020
+ # puts "No response received."
3021
+ # end
3022
+ #
3023
+ def delete_token_auth_user request, options = nil
3024
+ raise ::ArgumentError, "request must be provided" if request.nil?
3025
+
3026
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteTokenAuthUserRequest
3027
+
3028
+ # Converts hash and nil to an options object
3029
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3030
+
3031
+ # Customize the options with defaults
3032
+ metadata = @config.rpcs.delete_token_auth_user.metadata.to_h
3033
+
3034
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3035
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3036
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3037
+ gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
3038
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3039
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3040
+
3041
+ header_params = {}
3042
+ if request.name
3043
+ header_params["name"] = request.name
3044
+ end
3045
+
3046
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3047
+ metadata[:"x-goog-request-params"] ||= request_params_header
3048
+
3049
+ options.apply_defaults timeout: @config.rpcs.delete_token_auth_user.timeout,
3050
+ metadata: metadata,
3051
+ retry_policy: @config.rpcs.delete_token_auth_user.retry_policy
3052
+
3053
+ options.apply_defaults timeout: @config.timeout,
3054
+ metadata: @config.metadata,
3055
+ retry_policy: @config.retry_policy
3056
+
3057
+ @cloud_redis_cluster_stub.call_rpc :delete_token_auth_user, request, options: options do |response, operation|
3058
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3059
+ yield response, operation if block_given?
3060
+ throw :response, response
3061
+ end
3062
+ rescue ::GRPC::BadStatus => e
3063
+ raise ::Google::Cloud::Error.from_error(e)
3064
+ end
3065
+
3066
+ ##
3067
+ # Adds a auth token for a user of a token based auth enabled cluster.
3068
+ #
3069
+ # @overload add_auth_token(request, options = nil)
3070
+ # Pass arguments to `add_auth_token` via a request object, either of type
3071
+ # {::Google::Cloud::Redis::Cluster::V1beta1::AddAuthTokenRequest} or an equivalent Hash.
3072
+ #
3073
+ # @param request [::Google::Cloud::Redis::Cluster::V1beta1::AddAuthTokenRequest, ::Hash]
3074
+ # A request object representing the call parameters. Required. To specify no
3075
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3076
+ # @param options [::Gapic::CallOptions, ::Hash]
3077
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3078
+ #
3079
+ # @overload add_auth_token(token_auth_user: nil, auth_token: nil)
3080
+ # Pass arguments to `add_auth_token` via keyword arguments. Note that at
3081
+ # least one keyword argument is required. To specify no parameters, or to keep all
3082
+ # the default parameter values, pass an empty Hash as a request object (see above).
3083
+ #
3084
+ # @param token_auth_user [::String]
3085
+ # Required. The name of the token auth user resource that this auth token
3086
+ # will be added for. Format:
3087
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/tokenAuthUsers/\\{token_auth_user}
3088
+ # @param auth_token [::Google::Cloud::Redis::Cluster::V1beta1::AuthToken, ::Hash]
3089
+ # Required. The auth token to add.
3090
+ #
3091
+ # @yield [response, operation] Access the result along with the RPC operation
3092
+ # @yieldparam response [::Gapic::Operation]
3093
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3094
+ #
3095
+ # @return [::Gapic::Operation]
3096
+ #
3097
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3098
+ #
3099
+ # @example Basic example
3100
+ # require "google/cloud/redis/cluster/v1beta1"
3101
+ #
3102
+ # # Create a client object. The client can be reused for multiple calls.
3103
+ # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
3104
+ #
3105
+ # # Create a request. To set request fields, pass in keyword arguments.
3106
+ # request = Google::Cloud::Redis::Cluster::V1beta1::AddAuthTokenRequest.new
3107
+ #
3108
+ # # Call the add_auth_token method.
3109
+ # result = client.add_auth_token request
3110
+ #
3111
+ # # The returned object is of type Gapic::Operation. You can use it to
3112
+ # # check the status of an operation, cancel it, or wait for results.
3113
+ # # Here is how to wait for a response.
3114
+ # result.wait_until_done! timeout: 60
3115
+ # if result.response?
3116
+ # p result.response
3117
+ # else
3118
+ # puts "No response received."
3119
+ # end
3120
+ #
3121
+ def add_auth_token request, options = nil
3122
+ raise ::ArgumentError, "request must be provided" if request.nil?
3123
+
3124
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::AddAuthTokenRequest
3125
+
3126
+ # Converts hash and nil to an options object
3127
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3128
+
3129
+ # Customize the options with defaults
3130
+ metadata = @config.rpcs.add_auth_token.metadata.to_h
3131
+
3132
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3133
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3134
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3135
+ gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
3136
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3137
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3138
+
3139
+ header_params = {}
3140
+ if request.token_auth_user
3141
+ header_params["token_auth_user"] = request.token_auth_user
3142
+ end
3143
+
3144
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3145
+ metadata[:"x-goog-request-params"] ||= request_params_header
3146
+
3147
+ options.apply_defaults timeout: @config.rpcs.add_auth_token.timeout,
3148
+ metadata: metadata,
3149
+ retry_policy: @config.rpcs.add_auth_token.retry_policy
3150
+
3151
+ options.apply_defaults timeout: @config.timeout,
3152
+ metadata: @config.metadata,
3153
+ retry_policy: @config.retry_policy
3154
+
3155
+ @cloud_redis_cluster_stub.call_rpc :add_auth_token, request, options: options do |response, operation|
3156
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3157
+ yield response, operation if block_given?
3158
+ throw :response, response
3159
+ end
3160
+ rescue ::GRPC::BadStatus => e
3161
+ raise ::Google::Cloud::Error.from_error(e)
3162
+ end
3163
+
3164
+ ##
3165
+ # Removes a auth token for a user of a token based auth enabled instance.
3166
+ #
3167
+ # @overload delete_auth_token(request, options = nil)
3168
+ # Pass arguments to `delete_auth_token` via a request object, either of type
3169
+ # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteAuthTokenRequest} or an equivalent Hash.
3170
+ #
3171
+ # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteAuthTokenRequest, ::Hash]
3172
+ # A request object representing the call parameters. Required. To specify no
3173
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3174
+ # @param options [::Gapic::CallOptions, ::Hash]
3175
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3176
+ #
3177
+ # @overload delete_auth_token(name: nil)
3178
+ # Pass arguments to `delete_auth_token` via keyword arguments. Note that at
3179
+ # least one keyword argument is required. To specify no parameters, or to keep all
3180
+ # the default parameter values, pass an empty Hash as a request object (see above).
3181
+ #
3182
+ # @param name [::String]
3183
+ # Required. The name of the token auth user resource that this auth token
3184
+ # will be deleted from. Format:
3185
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{auth_token}
3186
+ #
3187
+ # @yield [response, operation] Access the result along with the RPC operation
3188
+ # @yieldparam response [::Gapic::Operation]
3189
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3190
+ #
3191
+ # @return [::Gapic::Operation]
3192
+ #
3193
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3194
+ #
3195
+ # @example Basic example
3196
+ # require "google/cloud/redis/cluster/v1beta1"
3197
+ #
3198
+ # # Create a client object. The client can be reused for multiple calls.
3199
+ # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
3200
+ #
3201
+ # # Create a request. To set request fields, pass in keyword arguments.
3202
+ # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteAuthTokenRequest.new
3203
+ #
3204
+ # # Call the delete_auth_token method.
3205
+ # result = client.delete_auth_token request
3206
+ #
3207
+ # # The returned object is of type Gapic::Operation. You can use it to
3208
+ # # check the status of an operation, cancel it, or wait for results.
3209
+ # # Here is how to wait for a response.
3210
+ # result.wait_until_done! timeout: 60
3211
+ # if result.response?
3212
+ # p result.response
3213
+ # else
3214
+ # puts "No response received."
3215
+ # end
3216
+ #
3217
+ def delete_auth_token request, options = nil
3218
+ raise ::ArgumentError, "request must be provided" if request.nil?
3219
+
3220
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteAuthTokenRequest
3221
+
3222
+ # Converts hash and nil to an options object
3223
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3224
+
3225
+ # Customize the options with defaults
3226
+ metadata = @config.rpcs.delete_auth_token.metadata.to_h
3227
+
3228
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3229
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3230
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3231
+ gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
3232
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3233
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3234
+
3235
+ header_params = {}
3236
+ if request.name
3237
+ header_params["name"] = request.name
3238
+ end
3239
+
3240
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3241
+ metadata[:"x-goog-request-params"] ||= request_params_header
3242
+
3243
+ options.apply_defaults timeout: @config.rpcs.delete_auth_token.timeout,
3244
+ metadata: metadata,
3245
+ retry_policy: @config.rpcs.delete_auth_token.retry_policy
3246
+
3247
+ options.apply_defaults timeout: @config.timeout,
3248
+ metadata: @config.metadata,
3249
+ retry_policy: @config.retry_policy
3250
+
3251
+ @cloud_redis_cluster_stub.call_rpc :delete_auth_token, request, options: options do |response, operation|
3252
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3253
+ yield response, operation if block_given?
3254
+ throw :response, response
3255
+ end
3256
+ rescue ::GRPC::BadStatus => e
3257
+ raise ::Google::Cloud::Error.from_error(e)
3258
+ end
3259
+
2464
3260
  ##
2465
3261
  # Configuration class for the CloudRedisCluster API.
2466
3262
  #
@@ -2756,6 +3552,46 @@ module Google
2756
3552
  # @return [::Gapic::Config::Method]
2757
3553
  #
2758
3554
  attr_reader :backup_cluster
3555
+ ##
3556
+ # RPC-specific configuration for `list_token_auth_users`
3557
+ # @return [::Gapic::Config::Method]
3558
+ #
3559
+ attr_reader :list_token_auth_users
3560
+ ##
3561
+ # RPC-specific configuration for `get_token_auth_user`
3562
+ # @return [::Gapic::Config::Method]
3563
+ #
3564
+ attr_reader :get_token_auth_user
3565
+ ##
3566
+ # RPC-specific configuration for `list_auth_tokens`
3567
+ # @return [::Gapic::Config::Method]
3568
+ #
3569
+ attr_reader :list_auth_tokens
3570
+ ##
3571
+ # RPC-specific configuration for `get_auth_token`
3572
+ # @return [::Gapic::Config::Method]
3573
+ #
3574
+ attr_reader :get_auth_token
3575
+ ##
3576
+ # RPC-specific configuration for `add_token_auth_user`
3577
+ # @return [::Gapic::Config::Method]
3578
+ #
3579
+ attr_reader :add_token_auth_user
3580
+ ##
3581
+ # RPC-specific configuration for `delete_token_auth_user`
3582
+ # @return [::Gapic::Config::Method]
3583
+ #
3584
+ attr_reader :delete_token_auth_user
3585
+ ##
3586
+ # RPC-specific configuration for `add_auth_token`
3587
+ # @return [::Gapic::Config::Method]
3588
+ #
3589
+ attr_reader :add_auth_token
3590
+ ##
3591
+ # RPC-specific configuration for `delete_auth_token`
3592
+ # @return [::Gapic::Config::Method]
3593
+ #
3594
+ attr_reader :delete_auth_token
2759
3595
 
2760
3596
  # @private
2761
3597
  def initialize parent_rpcs = nil
@@ -2803,6 +3639,22 @@ module Google
2803
3639
  @export_backup = ::Gapic::Config::Method.new export_backup_config
2804
3640
  backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster
2805
3641
  @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config
3642
+ list_token_auth_users_config = parent_rpcs.list_token_auth_users if parent_rpcs.respond_to? :list_token_auth_users
3643
+ @list_token_auth_users = ::Gapic::Config::Method.new list_token_auth_users_config
3644
+ get_token_auth_user_config = parent_rpcs.get_token_auth_user if parent_rpcs.respond_to? :get_token_auth_user
3645
+ @get_token_auth_user = ::Gapic::Config::Method.new get_token_auth_user_config
3646
+ list_auth_tokens_config = parent_rpcs.list_auth_tokens if parent_rpcs.respond_to? :list_auth_tokens
3647
+ @list_auth_tokens = ::Gapic::Config::Method.new list_auth_tokens_config
3648
+ get_auth_token_config = parent_rpcs.get_auth_token if parent_rpcs.respond_to? :get_auth_token
3649
+ @get_auth_token = ::Gapic::Config::Method.new get_auth_token_config
3650
+ add_token_auth_user_config = parent_rpcs.add_token_auth_user if parent_rpcs.respond_to? :add_token_auth_user
3651
+ @add_token_auth_user = ::Gapic::Config::Method.new add_token_auth_user_config
3652
+ delete_token_auth_user_config = parent_rpcs.delete_token_auth_user if parent_rpcs.respond_to? :delete_token_auth_user
3653
+ @delete_token_auth_user = ::Gapic::Config::Method.new delete_token_auth_user_config
3654
+ add_auth_token_config = parent_rpcs.add_auth_token if parent_rpcs.respond_to? :add_auth_token
3655
+ @add_auth_token = ::Gapic::Config::Method.new add_auth_token_config
3656
+ delete_auth_token_config = parent_rpcs.delete_auth_token if parent_rpcs.respond_to? :delete_auth_token
3657
+ @delete_auth_token = ::Gapic::Config::Method.new delete_auth_token_config
2806
3658
 
2807
3659
  yield self if block_given?
2808
3660
  end