# Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::SchemaService::Client (v2.8.0)

2.8.0 (latest) 2.7.0 2.6.2 2.5.0 2.4.0 2.3.1 2.2.0 2.1.1 2.0.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.2 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.2 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.

Client for the SchemaService service.


<br />

Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s.

## Inherits

- Object

## Includes

- [Google::Cloud::DiscoveryEngine::V1::SchemaService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Paths)

## Methods

### .configure

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

Configure the SchemaService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client-Configuration "Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all SchemaService clients
::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the SchemaService 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client#Google__Cloud__DiscoveryEngine__V1__SchemaService__Client_configure_class_ "Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client-Configuration "Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client-Configuration))

### #create_schema

    def create_schema(request, options = nil) -> ::Gapic::Operation
    def create_schema(parent: nil, schema: nil, schema_id: nil) -> ::Gapic::Operation

Creates a [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)").
**Overloads**

    def create_schema(request, options = nil) -> ::Gapic::Operation

Pass arguments to `create_schema` via a request object, either of type [CreateSchemaRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CreateSchemaRequest "Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CreateSchemaRequest), ::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 create_schema(parent: nil, schema: nil, schema_id: nil) -> ::Gapic::Operation

Pass arguments to `create_schema` 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 data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
- **schema** ([::Google::Cloud::DiscoveryEngine::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema), ::Hash) --- Required. The [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") to create.
- **schema_id** (::String) --- Required. The ID to use for the [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)"), which becomes the final component of the [Schema.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema#Google__Cloud__DiscoveryEngine__V1__Schema_name_instance_ "Google::Cloud::DiscoveryEngine::V1::Schema#name (method)").


  This field should conform to
  [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
  limit of 63 characters.
**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

```ruby
require "google/cloud/discovery_engine/v1"

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

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

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

### #delete_schema

    def delete_schema(request, options = nil) -> ::Gapic::Operation
    def delete_schema(name: nil) -> ::Gapic::Operation

Deletes a [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)").
**Overloads**

    def delete_schema(request, options = nil) -> ::Gapic::Operation

Pass arguments to `delete_schema` via a request object, either of type [DeleteSchemaRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DeleteSchemaRequest "Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DeleteSchemaRequest), ::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 delete_schema(name: nil) -> ::Gapic::Operation

Pass arguments to `delete_schema` 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 full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
**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

```ruby
require "google/cloud/discovery_engine/v1"

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

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

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

### #get_schema

    def get_schema(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Schema
    def get_schema(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Schema

Gets a [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)").
**Overloads**

    def get_schema(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Schema

Pass arguments to `get_schema` via a request object, either of type [GetSchemaRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GetSchemaRequest "Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GetSchemaRequest), ::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 get_schema(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Schema

Pass arguments to `get_schema` 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 full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::DiscoveryEngine::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

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

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

# Call the get_schema method.
result = client.get_schema request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::Schema.
p result
```

### #initialize

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

Create a new SchemaService client object.
**Yields**

- (config) --- Configure the SchemaService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new

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

### #list_schemas

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

Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s.
**Overloads**

    def list_schemas(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>

Pass arguments to `list_schemas` via a request object, either of type [ListSchemasRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ListSchemasRequest "Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ListSchemasRequest), ::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_schemas(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>

Pass arguments to `list_schemas` 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 data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
- **page_size** (::Integer) --- The maximum number of [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)")s to return. The service may return fewer than this value.


  If unspecified, at most 100
  [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)")s are returned.

  The maximum value is 1000; values above 1000 are set to 1000.
- **page_token** (::String) --- A page token, received from a previous [SchemaService.ListSchemas](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client#Google__Cloud__DiscoveryEngine__V1__SchemaService__Client_list_schemas_instance_ "Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas (method)") call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to
  [SchemaService.ListSchemas](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Client#Google__Cloud__DiscoveryEngine__V1__SchemaService__Client_list_schemas_instance_ "Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas (method)")
  must match the call that provided the page token.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

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

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

# Call the list_schemas method.
result = client.list_schemas 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::Schema.
  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::SchemaService::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SchemaService-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_schema

    def update_schema(request, options = nil) -> ::Gapic::Operation
    def update_schema(schema: nil, allow_missing: nil) -> ::Gapic::Operation

Updates a [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)").
**Overloads**

    def update_schema(request, options = nil) -> ::Gapic::Operation

Pass arguments to `update_schema` via a request object, either of type [UpdateSchemaRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-UpdateSchemaRequest "Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-UpdateSchemaRequest), ::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 update_schema(schema: nil, allow_missing: nil) -> ::Gapic::Operation

Pass arguments to `update_schema` 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**

- **schema** ([::Google::Cloud::DiscoveryEngine::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema), ::Hash) --- Required. The [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") to update.
- **allow_missing** (::Boolean) --- If set to true, and the [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") is not found, a new [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") is created. In this situation, `update_mask` is ignored.
**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

```ruby
require "google/cloud/discovery_engine/v1"

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

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

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