Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client (v2.3.0)

Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.

Client for the UserLicenseService service.

Service for managing User Licenses.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the UserLicenseService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all UserLicenseService clients
::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.configure do |config|
  config.timeout = 10.0
end

#batch_update_user_licenses

def batch_update_user_licenses(request, options = nil) -> ::Gapic::Operation
def batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil) -> ::Gapic::Operation

Updates the User License. This method is used for batch assign/unassign licenses to users.

Overloads
def batch_update_user_licenses(request, options = nil) -> ::Gapic::Operation
Pass arguments to batch_update_user_licenses via a request object, either of type BatchUpdateUserLicensesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, ::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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil) -> ::Gapic::Operation
Pass arguments to batch_update_user_licenses 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).
Parameters
  • inline_source (::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource, ::Hash) — The inline source for the input content for document embeddings.
  • parent (::String) — Required. The parent [UserStore][] resource name, format: projects/{project}/locations/{location}/userStores/{user_store_id}.
  • delete_unassigned_user_licenses (::Boolean) — Optional. If true, if user licenses removed associated license config, the user license will be deleted. By default which is false, the user license will be updated to unassigned state.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new

# Call the batch_update_user_licenses method.
result = client.batch_update_user_licenses 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

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the UserLicenseService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#initialize

def initialize() { |config| ... } -> Client

Create a new UserLicenseService client object.

Yields
  • (config) — Configure the UserLicenseService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config|
  config.timeout = 10.0
end

#list_user_licenses

def list_user_licenses(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>
def list_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>

Lists the User Licenses.

Overloads
def list_user_licenses(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>
Pass arguments to list_user_licenses via a request object, either of type ListUserLicensesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, ::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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>
Pass arguments to list_user_licenses 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).
Parameters
  • parent (::String) — Required. The parent [UserStore][] resource name, format: projects/{project}/locations/{location}/userStores/{user_store_id}.
  • page_size (::Integer) — Optional. Requested page size. Server may return fewer items than requested. If unspecified, defaults to 10. The maximum value is 50; values above 50 will be coerced to 50.

    If this field is negative, an INVALID_ARGUMENT error is returned.

  • page_token (::String) — Optional. A page token, received from a previous ListUserLicenses call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListUserLicenses must match the call that provided the page token.

  • filter (::String) —

    Optional. Filter for the list request.

    Supported fields:

    • license_assignment_state

    Examples:

    • license_assignment_state = ASSIGNED to list assigned user licenses.
    • license_assignment_state = NO_LICENSE to list not licensed users.
    • license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN to list users who attempted login but no license assigned.
    • license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN to filter out users who attempted login but no license assigned.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new

# Call the list_user_licenses method.
result = client.list_user_licenses 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::DiscoveryEngine::V1::UserLicense.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)