Recommendations AI V1beta1 API - Class Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client (v0.5.0)

Reference documentation and code samples for the Recommendations AI V1beta1 API class Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.

REST client for the PredictionApiKeyRegistry service.

Service for registering API keys for use with the predict method. If you use an API key to request predictions, you must first register the API key. Otherwise, your prediction request is rejected. If you use OAuth to authenticate your predict method call, you do not need to register an API key. You can register up to 20 API keys per project.

Inherits

  • Object

Methods

.configure

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

Configure the PredictionApiKeyRegistry 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 PredictionApiKeyRegistry clients
::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the PredictionApiKeyRegistry 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

#create_prediction_api_key_registration

def create_prediction_api_key_registration(request, options = nil) -> ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration
def create_prediction_api_key_registration(parent: nil, prediction_api_key_registration: nil) -> ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration

Register an API key for use with predict method.

Overloads
def create_prediction_api_key_registration(request, options = nil) -> ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration
Pass arguments to create_prediction_api_key_registration via a request object, either of type CreatePredictionApiKeyRegistrationRequest or an equivalent Hash.
Parameters
def create_prediction_api_key_registration(parent: nil, prediction_api_key_registration: nil) -> ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration
Pass arguments to create_prediction_api_key_registration 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
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_prediction_api_key_registration

def delete_prediction_api_key_registration(request, options = nil) -> ::Google::Protobuf::Empty
def delete_prediction_api_key_registration(name: nil) -> ::Google::Protobuf::Empty

Unregister an apiKey from using for predict method.

Overloads
def delete_prediction_api_key_registration(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_prediction_api_key_registration via a request object, either of type DeletePredictionApiKeyRegistrationRequest or an equivalent Hash.
Parameters
def delete_prediction_api_key_registration(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_prediction_api_key_registration 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).
Parameter
  • name (::String) — Required. The API key to unregister including full resource path. projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

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

Create a new PredictionApiKeyRegistry REST client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_prediction_api_key_registrations

def list_prediction_api_key_registrations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>
def list_prediction_api_key_registrations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>

List the registered apiKeys for use with predict method.

Overloads
def list_prediction_api_key_registrations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>
Pass arguments to list_prediction_api_key_registrations via a request object, either of type ListPredictionApiKeyRegistrationsRequest or an equivalent Hash.
Parameters
def list_prediction_api_key_registrations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>
Pass arguments to list_prediction_api_key_registrations 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 placement resource name such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store
  • page_size (::Integer) — Optional. Maximum number of results to return per page. If unset, the service will choose a reasonable default.
  • page_token (::String) — Optional. The previous ListPredictionApiKeyRegistration.nextPageToken.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.