Skip to content

Commit

Permalink
feat: Automated regeneration of Retail client (#12154)
Browse files Browse the repository at this point in the history
Auto-created at 2024-09-17 13:17:35 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Sep 17, 2024
1 parent 7012481 commit 6e5b622
Show file tree
Hide file tree
Showing 16 changed files with 689 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clients/retail/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_retail, "~> 0.13"}]
[{:google_api_retail, "~> 0.14"}]
end
```

Expand Down
2 changes: 1 addition & 1 deletion clients/retail/lib/google_api/retail/v2/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Retail.V2 do
API client metadata for GoogleApi.Retail.V2.
"""

@discovery_revision "20240822"
@discovery_revision "20240912"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeInterval do
@moduledoc """
Product attribute name and numeric interval.
## Attributes
* `interval` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2Interval.t`, *default:* `nil`) - The numeric interval (e.g. [10, 20))
* `name` (*type:* `String.t`, *default:* `nil`) - The attribute name (e.g. "length")
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:interval => GoogleApi.Retail.V2.Model.GoogleCloudRetailV2Interval.t() | nil,
:name => String.t() | nil
}

field(:interval, as: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2Interval)
field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeInterval do
def decode(value, options) do
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeInterval.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeInterval 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,49 @@
# 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.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeValue do
@moduledoc """
Product attribute which structured by an attribute name and value. This structure is used in conversational search filters and answers. For example, if we have `name=color` and `value=red`, this means that the color is `red`.
## Attributes
* `name` (*type:* `String.t`, *default:* `nil`) - The attribute name.
* `value` (*type:* `String.t`, *default:* `nil`) - The attribute value.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:name => String.t() | nil,
:value => String.t() | nil
}

field(:name)
field(:value)
end

defimpl Poison.Decoder, for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeValue do
def decode(value, options) do
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeValue.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeValue do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defmodule GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequest do
* `boostSpec` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestBoostSpec.t`, *default:* `nil`) - Boost specification to boost certain products. For more information, see [Boost results](https://cloud.google.com/retail/docs/boosting). Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.
* `branch` (*type:* `String.t`, *default:* `nil`) - The branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use "default_branch" as the branch ID or leave this field empty, to search products under the default branch.
* `canonicalFilter` (*type:* `String.t`, *default:* `nil`) - The default filter that is applied when a user performs a search without checking any filters on the search page. The filter applied to every search request when quality improvement such as query expansion is needed. In the case a query does not have a sufficient amount of results this filter will be used to determine whether or not to enable the query expansion flow. The original filter will still be used for the query expanded search. This field is strongly recommended to achieve high search quality. For more information about filter syntax, see SearchRequest.filter.
* `conversationalSearchSpec` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec.t`, *default:* `nil`) - Optional. This field specifies all conversational related parameters addition to traditional retail search.
* `dynamicFacetSpec` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestDynamicFacetSpec.t`, *default:* `nil`) - Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic to enable dynamic facets. Do not set this field. The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.
* `entity` (*type:* `String.t`, *default:* `nil`) - The entity for customers that may run multiple different entities, domains, sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, `google.com`, `youtube.com`, etc. If this is set, it should be exactly matched with UserEvent.entity to get search results boosted by entity.
* `facetSpecs` (*type:* `list(GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestFacetSpec.t)`, *default:* `nil`) - Facet specifications for faceted search. If empty, no facets are returned. A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.
Expand All @@ -39,6 +40,7 @@ defmodule GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequest do
* `queryExpansionSpec` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestQueryExpansionSpec.t`, *default:* `nil`) - The query expansion specification that specifies the conditions under which query expansion occurs. For more information, see [Query expansion](https://cloud.google.com/retail/docs/result-size#query_expansion).
* `searchMode` (*type:* `String.t`, *default:* `nil`) - The search mode of the search request. If not specified, a single search request triggers both product search and faceted search.
* `spellCorrectionSpec` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestSpellCorrectionSpec.t`, *default:* `nil`) - The spell correction specification that specifies the mode under which spell correction will take effect.
* `tileNavigationSpec` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestTileNavigationSpec.t`, *default:* `nil`) - Optional. This field specifies tile navigation related parameters.
* `userInfo` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2UserInfo.t`, *default:* `nil`) - User information.
* `variantRollupKeys` (*type:* `list(String.t)`, *default:* `nil`) - The keys to fetch and rollup the matching variant Products attributes, FulfillmentInfo or LocalInventorys attributes. The attributes from all the matching variant Products or LocalInventorys are merged and de-duplicated. Notice that rollup attributes will lead to extra query latency. Maximum number of keys is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID must be provided in the format of "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", "pickupInStore" is fulfillment type and "store123" is the store ID. Supported keys are: * colorFamilies * price * originalPrice * discount * variantId * inventory(place_id,price) * inventory(place_id,original_price) * inventory(place_id,attributes.key), where key is any key in the Product.local_inventories.attributes map. * attributes.key, where key is any key in the Product.attributes map. * pickupInStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "pickup-in-store". * shipToStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "ship-to-store". * sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "same-day-delivery". * nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "next-day-delivery". * customFulfillment1.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-1". * customFulfillment2.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-2". * customFulfillment3.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-3". * customFulfillment4.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-4". * customFulfillment5.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-5". If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.
* `visitorId` (*type:* `String.t`, *default:* `nil`) - Required. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This should be the same identifier as UserEvent.visitor_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
Expand All @@ -51,6 +53,9 @@ defmodule GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequest do
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestBoostSpec.t() | nil,
:branch => String.t() | nil,
:canonicalFilter => String.t() | nil,
:conversationalSearchSpec =>
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec.t()
| nil,
:dynamicFacetSpec =>
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestDynamicFacetSpec.t() | nil,
:entity => String.t() | nil,
Expand All @@ -73,6 +78,8 @@ defmodule GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequest do
:spellCorrectionSpec =>
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestSpellCorrectionSpec.t()
| nil,
:tileNavigationSpec =>
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestTileNavigationSpec.t() | nil,
:userInfo => GoogleApi.Retail.V2.Model.GoogleCloudRetailV2UserInfo.t() | nil,
:variantRollupKeys => list(String.t()) | nil,
:visitorId => String.t() | nil
Expand All @@ -82,6 +89,10 @@ defmodule GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequest do
field(:branch)
field(:canonicalFilter)

field(:conversationalSearchSpec,
as: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec
)

field(:dynamicFacetSpec,
as: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestDynamicFacetSpec
)
Expand Down Expand Up @@ -117,6 +128,10 @@ defmodule GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequest do
as: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestSpellCorrectionSpec
)

field(:tileNavigationSpec,
as: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestTileNavigationSpec
)

field(:userInfo, as: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2UserInfo)
field(:variantRollupKeys, type: :list)
field(:visitorId)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec do
@moduledoc """
This field specifies all conversational related parameters addition to traditional retail search.
## Attributes
* `conversationId` (*type:* `String.t`, *default:* `nil`) - This field specifies the conversation id, which maintains the state of the conversation between client side and server side. Use the value from the previous ConversationalSearchResult.conversation_id. For the initial request, this should be empty.
* `followupConversationRequested` (*type:* `boolean()`, *default:* `nil`) - This field specifies whether the customer would like to do conversational search. If this field is set to true, conversational related extra information will be returned from server side, including follow-up question, answer options, etc.
* `userAnswer` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer.t`, *default:* `nil`) - This field specifies the current user answer during the conversational search. This can be either user selected from suggested answers or user input plain text.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:conversationId => String.t() | nil,
:followupConversationRequested => boolean() | nil,
:userAnswer =>
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer.t()
| nil
}

field(:conversationId)
field(:followupConversationRequested)

field(:userAnswer,
as:
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer
)
end

defimpl Poison.Decoder,
for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec do
def decode(value, options) do
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec.decode(
value,
options
)
end
end

defimpl Poison.Encoder,
for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec 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,62 @@
# 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.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer do
@moduledoc """
This field specifies the current user answer during the conversational search. This can be either user selected from suggested answers or user input plain text.
## Attributes
* `selectedAnswer` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswerSelectedAnswer.t`, *default:* `nil`) - This field specifies the selected attributes during the conversational search. This should be a subset of ConversationalSearchResult.suggested_answers.
* `textAnswer` (*type:* `String.t`, *default:* `nil`) - This field specifies the incremental input text from the user during the conversational search.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:selectedAnswer =>
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswerSelectedAnswer.t()
| nil,
:textAnswer => String.t() | nil
}

field(:selectedAnswer,
as:
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswerSelectedAnswer
)

field(:textAnswer)
end

defimpl Poison.Decoder,
for:
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer do
def decode(value, options) do
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer.decode(
value,
options
)
end
end

defimpl Poison.Encoder,
for:
GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading

0 comments on commit 6e5b622

Please sign in to comment.