Skip to content

Commit

Permalink
feat: Automated regeneration of DiscoveryEngine client (#12739)
Browse files Browse the repository at this point in the history
Auto-created at 2024-12-18 13:17:34 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Dec 18, 2024
1 parent 3330d2a commit 179ea31
Show file tree
Hide file tree
Showing 94 changed files with 4,939 additions and 8 deletions.
2 changes: 1 addition & 1 deletion clients/discovery_engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_discovery_engine, "~> 0.27"}]
[{:google_api_discovery_engine, "~> 0.28"}]
end
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,85 @@ defmodule GoogleApi.DiscoveryEngine.V1.Api.Projects do
)
end

@doc """
Generates grounded content.

## Parameters

* `connection` (*type:* `GoogleApi.DiscoveryEngine.V1.Connection.t`) - Connection to server
* `location` (*type:* `String.t`) - Required. Location resource. Format: `projects/{project}/locations/{location}`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - 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.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - 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.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentResponse{}}` on success
* `{:error, info}` on failure
"""
@spec discoveryengine_projects_locations_generate_grounded_content(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok,
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def discoveryengine_projects_locations_generate_grounded_content(
connection,
location,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+location}:generateGroundedContent", %{
"location" => URI.encode(location, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(
opts ++
[
struct:
%GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentResponse{}
]
)
end

@doc """
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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.DiscoveryEngine.V1 do
API client metadata for GoogleApi.DiscoveryEngine.V1.
"""

@discovery_revision "20241210"
@discovery_revision "20241216"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CmekCon
* `kmsKeyVersion` (*type:* `String.t`, *default:* `nil`) - Kms key version resource name which will be used to encrypt resources `/cryptoKeyVersions/{keyVersion}`.
* `lastRotationTimestampMicros` (*type:* `String.t`, *default:* `nil`) - Output only. The timestamp of the last key rotation.
* `name` (*type:* `String.t`, *default:* `nil`) - Required. Name of the CmekConfig, of the form `projects/{project}/locations/{location}/cmekConfig` or `projects/{project}/locations/{location}/cmekConfigs/{cmekConfig}`.
* `singleRegionKeys` (*type:* `list(GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1SingleRegionKey.t)`, *default:* `nil`) - Optional. Single-regional CMEKs that are required for some VAIS features.
* `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the CmekConfig.
"""

Expand All @@ -37,6 +38,11 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CmekCon
:kmsKeyVersion => String.t() | nil,
:lastRotationTimestampMicros => String.t() | nil,
:name => String.t() | nil,
:singleRegionKeys =>
list(
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1SingleRegionKey.t()
)
| nil,
:state => String.t() | nil
}

Expand All @@ -45,6 +51,12 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CmekCon
field(:kmsKeyVersion)
field(:lastRotationTimestampMicros)
field(:name)

field(:singleRegionKeys,
as: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1SingleRegionKey,
type: :list
)

field(:state)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DataSto
* `displayName` (*type:* `String.t`, *default:* `nil`) - Required. The data store display name. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
* `documentProcessingConfig` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentProcessingConfig.t`, *default:* `nil`) - Configuration for Document understanding and enrichment.
* `industryVertical` (*type:* `String.t`, *default:* `nil`) - Immutable. The industry vertical that the data store registers.
* `isInfobotFaqDataStore` (*type:* `boolean()`, *default:* `nil`) - Optional. If set, this DataStore is an Infobot FAQ DataStore.
* `kmsKeyName` (*type:* `String.t`, *default:* `nil`) - Input only. The KMS key to be used to protect this DataStore at creation time. Must be set for requests that need to comply with CMEK Org Policy protections. If this field is set and processed successfully, the DataStore will be protected by the KMS key, as indicated in the cmek_config field.
* `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
* `servingConfigDataStore` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DataStoreServingConfigDataStore.t`, *default:* `nil`) - Optional. Stores serving config at DataStore level.
Expand Down Expand Up @@ -57,6 +58,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DataSto
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentProcessingConfig.t()
| nil,
:industryVertical => String.t() | nil,
:isInfobotFaqDataStore => boolean() | nil,
:kmsKeyName => String.t() | nil,
:name => String.t() | nil,
:servingConfigDataStore =>
Expand Down Expand Up @@ -90,6 +92,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DataSto
)

field(:industryVertical)
field(:isInfobotFaqDataStore)
field(:kmsKeyName)
field(:name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Documen
* `content` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentContent.t`, *default:* `nil`) - The unstructured data linked to this document. Content must be set if this document is under a `CONTENT_REQUIRED` data store.
* `derivedStructData` (*type:* `map()`, *default:* `nil`) - Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
* `id` (*type:* `String.t`, *default:* `nil`) - Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.
* `indexStatus` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentIndexStatus.t`, *default:* `nil`) - Output only. The index status of the document. * If document is indexed successfully, the index_time field is populated. * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * Otherwise, index_status is unset.
* `indexStatus` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentIndexStatus.t`, *default:* `nil`) - Output only. The index status of the document. * If document is indexed successfully, the index_time field is populated. * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * Otherwise, if document's index is in progress, the pending_message field is populated.
* `indexTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed.
* `jsonData` (*type:* `String.t`, *default:* `nil`) - The JSON string representation of the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
* `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Documen
* `errorSamples` (*type:* `list(GoogleApi.DiscoveryEngine.V1.Model.GoogleRpcStatus.t)`, *default:* `nil`) - A sample of errors encountered while indexing the document. If this field is populated, the document is not indexed due to errors.
* `indexTime` (*type:* `DateTime.t`, *default:* `nil`) - The time when the document was indexed. If this field is populated, it means the document has been indexed.
* `pendingMessage` (*type:* `String.t`, *default:* `nil`) - Immutable. The message indicates the document index is in progress. If this field is populated, the document index is pending.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:errorSamples => list(GoogleApi.DiscoveryEngine.V1.Model.GoogleRpcStatus.t()) | nil,
:indexTime => DateTime.t() | nil
:indexTime => DateTime.t() | nil,
:pendingMessage => String.t() | nil
}

field(:errorSamples, as: GoogleApi.DiscoveryEngine.V1.Model.GoogleRpcStatus, type: :list)
field(:indexTime, as: DateTime)
field(:pendingMessage)
end

defimpl Poison.Decoder,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequest do
@moduledoc """
Top-level message sent by the client for the `GenerateGroundedContent` method.
## Attributes
* `contents` (*type:* `list(GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GroundedGenerationContent.t)`, *default:* `nil`) - Content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.
* `generationSpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestGenerationSpec.t`, *default:* `nil`) - Content generation specification.
* `groundingSpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestGroundingSpec.t`, *default:* `nil`) - Grounding specification.
* `systemInstruction` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GroundedGenerationContent.t`, *default:* `nil`) - Content of the system instruction for the current API. These instructions will take priority over any other prompt instructions if the selected model is supporting them.
* `userLabels` (*type:* `map()`, *default:* `nil`) - The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:contents =>
list(
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GroundedGenerationContent.t()
)
| nil,
:generationSpec =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestGenerationSpec.t()
| nil,
:groundingSpec =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestGroundingSpec.t()
| nil,
:systemInstruction =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GroundedGenerationContent.t()
| nil,
:userLabels => map() | nil
}

field(:contents,
as: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GroundedGenerationContent,
type: :list
)

field(:generationSpec,
as:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestGenerationSpec
)

field(:groundingSpec,
as:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestGroundingSpec
)

field(:systemInstruction,
as: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GroundedGenerationContent
)

field(:userLabels, type: :map)
end

defimpl Poison.Decoder,
for:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequest do
def decode(value, options) do
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequest.decode(
value,
options
)
end
end

defimpl Poison.Encoder,
for:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequest do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestDynamicRetrievalConfiguration do
@moduledoc """
Describes the options to customize dynamic retrieval.
## Attributes
* `predictor` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestDynamicRetrievalConfigurationDynamicRetrievalPredictor.t`, *default:* `nil`) - Specification for the predictor for dynamic retrieval.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:predictor =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestDynamicRetrievalConfigurationDynamicRetrievalPredictor.t()
| nil
}

field(:predictor,
as:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestDynamicRetrievalConfigurationDynamicRetrievalPredictor
)
end

defimpl Poison.Decoder,
for:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestDynamicRetrievalConfiguration do
def decode(value, options) do
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestDynamicRetrievalConfiguration.decode(
value,
options
)
end
end

defimpl Poison.Encoder,
for:
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1GenerateGroundedContentRequestDynamicRetrievalConfiguration do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading

0 comments on commit 179ea31

Please sign in to comment.