Class: Google::Apis::FirebasemlV1beta2::FirebaseMLService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
generated/google/apis/firebaseml_v1beta2/service.rb

Overview

Firebase ML API

Access custom machine learning models hosted via Firebase ML.

Examples:

require 'google/apis/firebaseml_v1beta2'

Firebaseml = Google::Apis::FirebasemlV1beta2 # Alias the module
service = Firebaseml::FirebaseMLService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFirebaseMLService

Returns a new instance of FirebaseMLService.



45
46
47
48
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 45

def initialize
  super('https://firebaseml.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



38
39
40
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 38

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



43
44
45
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#create_project_model(parent, model_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV1beta2::Operation

Creates a model in Firebase ML. The longrunning operation will eventually return a Model

Parameters:

  • parent (String)

    Required. The parent project resource where the model is to be created. The parent must have the form projects/project_id``

  • model_object (Google::Apis::FirebasemlV1beta2::Model) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



73
74
75
76
77
78
79
80
81
82
83
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 73

def create_project_model(parent, model_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+parent}/models', options)
  command.request_representation = Google::Apis::FirebasemlV1beta2::Model::Representation
  command.request_object = model_object
  command.response_representation = Google::Apis::FirebasemlV1beta2::Operation::Representation
  command.response_class = Google::Apis::FirebasemlV1beta2::Operation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_model(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV1beta2::Empty

Deletes a model

Parameters:

  • name (String)

    Required. The name of the model to delete. The name must have the form projects/project_id/models/model_id``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



106
107
108
109
110
111
112
113
114
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 106

def delete_project_model(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::FirebasemlV1beta2::Empty::Representation
  command.response_class = Google::Apis::FirebasemlV1beta2::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_model(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV1beta2::Model

Gets a model resource.

Parameters:

  • name (String)

    Required. The name of the model to get. The name must have the form projects/ project_id/models/model_id``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



137
138
139
140
141
142
143
144
145
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 137

def get_project_model(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::FirebasemlV1beta2::Model::Representation
  command.response_class = Google::Apis::FirebasemlV1beta2::Model
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV1beta2::Operation

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters:

  • name (String)

    The name of the operation resource.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



246
247
248
249
250
251
252
253
254
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 246

def get_project_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::FirebasemlV1beta2::Operation::Representation
  command.response_class = Google::Apis::FirebasemlV1beta2::Operation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_models(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV1beta2::ListModelsResponse

Lists the models

Parameters:

  • parent (String)

    Required. The name of the parent to list models for. The parent must have the form projects/project_id`'

  • filter (String) (defaults to: nil)

    A filter for the list e.g. 'tags: abc' to list models which are tagged with " abc"

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of items to return

  • page_token (String) (defaults to: nil)

    The next_page_token value returned from a previous List request, if any.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



175
176
177
178
179
180
181
182
183
184
185
186
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 175

def list_project_models(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+parent}/models', options)
  command.response_representation = Google::Apis::FirebasemlV1beta2::ListModelsResponse::Representation
  command.response_class = Google::Apis::FirebasemlV1beta2::ListModelsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_model(name, model_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV1beta2::Operation

Updates a model. The longrunning operation will eventually return a Model.

Parameters:

  • name (String)

    The resource name of the Model. Model names have the form projects/ project_id/models/model_id`` The name is ignored when creating a model.

  • model_object (Google::Apis::FirebasemlV1beta2::Model) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    The update mask

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



212
213
214
215
216
217
218
219
220
221
222
223
# File 'generated/google/apis/firebaseml_v1beta2/service.rb', line 212

def patch_project_model(name, model_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1beta2/{+name}', options)
  command.request_representation = Google::Apis::FirebasemlV1beta2::Model::Representation
  command.request_object = model_object
  command.response_representation = Google::Apis::FirebasemlV1beta2::Operation::Representation
  command.response_class = Google::Apis::FirebasemlV1beta2::Operation
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end