Skip to content

Commit

Permalink
feat: Automated regeneration of DiscoveryEngine client (#12513)
Browse files Browse the repository at this point in the history
Auto-created at 2024-11-12 13:15:12 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Nov 12, 2024
1 parent a66a60a commit fefaa58
Show file tree
Hide file tree
Showing 25 changed files with 207 additions and 271 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.23"}]
[{:google_api_discovery_engine, "~> 0.24"}]
end
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13669,6 +13669,80 @@ defmodule GoogleApi.DiscoveryEngine.V1.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.DiscoveryEngine.V1.Model.GoogleApiHttpBody{}])
end

@doc """
Bulk import of user events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.

## Parameters

* `connection` (*type:* `GoogleApi.DiscoveryEngine.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
* `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.GoogleCloudDiscoveryengineV1ImportUserEventsRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.DiscoveryEngine.V1.Model.GoogleLongrunningOperation{}}` on success
* `{:error, info}` on failure
"""
@spec discoveryengine_projects_locations_user_events_import(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.DiscoveryEngine.V1.Model.GoogleLongrunningOperation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def discoveryengine_projects_locations_user_events_import(
connection,
parent,
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/{+parent}/userEvents:import", %{
"parent" => URI.encode(parent, &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.GoogleLongrunningOperation{}]
)
end

@doc """
Writes a single user event.

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 "20241031"
@discovery_revision "20241110"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1AnswerQ
## Attributes
* `filteringLevel` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies whether to enable the filtering based on grounding score and at what level.
* `includeGroundingSupports` (*type:* `boolean()`, *default:* `nil`) - Optional. Specifies whether to include grounding_supports in the answer. The default value is `false`. When this field is set to `true`, returned answer will have `grounding_score` and will contain GroundingSupports for each claim.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:filteringLevel => String.t() | nil,
:includeGroundingSupports => boolean() | nil
}

field(:filteringLevel)
field(:includeGroundingSupports)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CheckGr
* `citationIndices` (*type:* `list(integer())`, *default:* `nil`) - A list of indices (into 'cited_chunks') specifying the citations associated with the claim. For instance [1,3,4] means that cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited supporting for the claim. A citation to a fact indicates that the claim is supported by the fact.
* `claimText` (*type:* `String.t`, *default:* `nil`) - Text for the claim in the answer candidate. Always provided regardless of whether citations or anti-citations are found.
* `endPos` (*type:* `integer()`, *default:* `nil`) - Position indicating the end of the claim in the answer candidate, exclusive.
* `groundingCheckRequired` (*type:* `boolean()`, *default:* `nil`) - Indicates that this claim required grounding check. When the system decided this claim doesn't require attribution/grounding check, this field will be set to false. In that case, no grounding check was done for the claim and therefore citation_indices, anti_citation_indices, and score should not be returned.
* `groundingCheckRequired` (*type:* `boolean()`, *default:* `nil`) - Indicates that this claim required grounding check. When the system decided this claim doesn't require attribution/grounding check, this field will be set to false. In that case, no grounding check was done for the claim and therefore citation_indices should not be returned.
* `startPos` (*type:* `integer()`, *default:* `nil`) - Position indicating the start of the claim in the answer candidate, measured in bytes.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Chunk d
* `id` (*type:* `String.t`, *default:* `nil`) - Unique chunk ID of the current chunk.
* `name` (*type:* `String.t`, *default:* `nil`) - The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
* `pageSpan` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1ChunkPageSpan.t`, *default:* `nil`) - Page span of the chunk.
* `relevanceScore` (*type:* `float()`, *default:* `nil`) - Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchService.SearchResponse.
* `relevanceScore` (*type:* `float()`, *default:* `nil`) - Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchResponse.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Documen
## Attributes
* `conversionValue` (*type:* `number()`, *default:* `nil`) - Optional. The conversion value associated with this Document. Must be set if UserEvent.event_type is "conversion". For example, a value of 1000 signifies that 1000 seconds were spent viewing a Document for the `watch` conversion type.
* `id` (*type:* `String.t`, *default:* `nil`) - The Document resource ID.
* `joined` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the referenced Document can be found in the data store.
* `name` (*type:* `String.t`, *default:* `nil`) - The Document resource full name, of the form: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
Expand All @@ -32,6 +33,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Documen
use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:conversionValue => number() | nil,
:id => String.t() | nil,
:joined => boolean() | nil,
:name => String.t() | nil,
Expand All @@ -40,6 +42,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Documen
:uri => String.t() | nil
}

field(:conversionValue)
field(:id)
field(:joined)
field(:name)
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Ranking
* `content` (*type:* `String.t`, *default:* `nil`) - The content of the record. Empty by default. At least one of title or content should be set otherwise an INVALID_ARGUMENT error is thrown.
* `id` (*type:* `String.t`, *default:* `nil`) - The unique ID to represent the record.
* `score` (*type:* `number()`, *default:* `nil`) - The score of this record based on the given query and selected model.
* `score` (*type:* `number()`, *default:* `nil`) - The score of this record based on the given query and selected model. The score will be rounded to 2 decimal places. If the score is close to 0, it will be rounded to 0.0001 to avoid returning unset.
* `title` (*type:* `String.t`, *default:* `nil`) - The title of the record. Empty by default. At least one of title or content should be set otherwise an INVALID_ARGUMENT error is thrown.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,23 @@ defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Session
## Attributes
* `answer` (*type:* `String.t`, *default:* `nil`) - The resource name of the answer to the user query. Only set if the answer generation (/answer API call) happened in this turn.
* `detailedAnswer` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Answer.t`, *default:* `nil`) - Output only. In ConversationalSearchService.GetSession API, if GetSessionRequest.include_answer_details is set to true, this field will be populated when getting answer query session.
* `query` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Query.t`, *default:* `nil`) - The user query.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:answer => String.t() | nil,
:detailedAnswer =>
GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Answer.t() | nil,
:query => GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Query.t() | nil
}

field(:answer)

field(:detailedAnswer, as: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Answer)

field(:query, as: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1Query)
end

Expand Down
Loading

0 comments on commit fefaa58

Please sign in to comment.