Skip to content

Commit

Permalink
feat: add ControlService feat: and ServingConfigService (#139)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 425694473
Source-Link: googleapis/googleapis@eceb9e8
Source-Link: googleapis/googleapis-gen@4547875
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDU0Nzg3NTg2NjY2MDZiNzVmZjI5ZWY2NDIyZDcxZjVjNDNkYmJlNSJ9
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 2, 2022
1 parent 6fb130c commit 1e20e28
Show file tree
Hide file tree
Showing 18 changed files with 5,240 additions and 425 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ message MerchantCenterLink {
// _ads", "Free_listings", "Free_local_listings"
// NOTE: The string values are case sensitive.
repeated string destinations = 3;

// Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
// code. List of values can be found
// [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
// under the `region` tag. If left blank no region filtering will be
// performed.
//
// Example value: `US`.
string region_code = 4;

// Language of the title/description and other string attributes. Use language
// tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
// ISO 639-1.
//
// This specifies the language of offers in Merchant Center that will be
// accepted.
// If empty no language filtering will be performed.
string language_code = 5;
}

// Configures Merchant Center linking.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/retail/v2alpha/catalog.proto";
import "google/cloud/retail/v2alpha/import_config.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,249 @@ option objc_class_prefix = "RETAIL";
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";

// The type of solution.
enum SolutionType {
// Default value.
SOLUTION_TYPE_UNSPECIFIED = 0;

// Used for Recommendations AI.
SOLUTION_TYPE_RECOMMENDATION = 1;

// Used for Retail Search.
SOLUTION_TYPE_SEARCH = 2;
}

// Metadata that is used to define a condition that triggers an action.
// A valid condition must specify at least one of 'query_terms' or
// 'products_filter'. If multiple fields are specified, the condition is met if
// all the fields are satisfied e.g. if a set of query terms and product_filter
// are set, then only items matching the product_filter for requests with a
// query matching the query terms wil get boosted.
message Condition {
// Query terms that we want to match on.
message QueryTerm {
// The value of the term to match on.
// Value cannot be empty.
// Value can have at most 3 terms if specified as a partial match. Each
// space separated string is considered as one term.
// Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not
// allowed for partial match.
string value = 1;

// Whether this is supposed to be a full or partial match.
bool full_match = 2;
}

// Used for time-dependent conditions.
// Example: Want to have rule applied for week long sale.
message TimeRange {
// Start of time range. Range is inclusive.
google.protobuf.Timestamp start_time = 1;

// End of time range. Range is inclusive.
google.protobuf.Timestamp end_time = 2;
}

// A list (up to 10 entries) of terms to match the query on. If not
// specified, match all queries.
// If many query terms are specified, the condition
// is matched if any of the terms is a match (i.e. using the OR operator).
repeated QueryTerm query_terms = 1;

// Range of time(s) specifying when Condition is active.
// Condition true if any time range matches.
repeated TimeRange active_time_range = 3;
}

// A rule is a condition-action pair
// * A condition defines when a rule is to be triggered.
// * An action specifies what occurs on that trigger.
// Currently only boost rules are supported.
// Currently only supported by the search endpoint.
message Rule {
// A boost action to apply to results matching condition specified above.
message BoostAction {
// Strength of the condition boost, which must be in [-1, 1]. Negative
// boost means demotion. Default is 0.0.
//
// Setting to 1.0 gives the item a big promotion. However, it does not
// necessarily mean that the boosted item will be the top result at all
// times, nor that other items will be excluded. Results could still be
// shown even when none of them matches the condition. And results that
// are significantly more relevant to the search query can still trump
// your heavily favored but irrelevant items.
//
// Setting to -1.0 gives the item a big demotion. However, results that
// are deeply relevant might still be shown. The item will have an
// upstream battle to get a fairly high ranking, but it is not blocked out
// completely.
//
// Setting to 0.0 means no boost applied. The boosting condition is
// ignored.
float boost = 1;

// The filter can have a max size of 5000 characters.
// An expression which specifies which products to apply an action to.
// The syntax and supported fields are the same as a filter expression. See
// [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
// for detail syntax and limitations.
//
// Examples:
//
// * To boost products with product ID "product_1" or "product_2", and
// color
// "Red" or "Blue":<br>
// *(id: ANY("product_1", "product_2"))<br>*
// *AND<br>*
// *(colorFamilies: ANY("Red", "Blue"))<br>*
string products_filter = 2;
}

// * Rule Condition:
// - No [Condition][query_terms] provided is a global match.
// - 1 or more [Condition][query_terms] provided is combined with OR
// operator.
// * Action Input: The request query and filter that will be applied to the
// retrieved products, in addition to any filters already provided with the
// SearchRequest. The AND operator is used to combine the query's existing
// filters with the filter rule(s). NOTE: May result in 0 results when
// filters conflict.
// * Action Result: Filters the returned objects to be ONLY those that passed
// the filter.
message FilterAction {
// A filter to apply on the matching condition results. Supported features:
//
// * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
// set.
// * Filter syntax is identical to
// [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
// See more
// details at the Retail Search
// [user guide](/retail/search/docs/filter-and-order#filter).
// * To filter products with product ID "product_1" or "product_2", and
// color
// "Red" or "Blue":<br>
// *(id: ANY("product_1", "product_2"))<br>*
// *AND<br>*
// *(colorFamilies: ANY("Red", "Blue"))<br>*
string filter = 1;
}

// Redirects a shopper to a specific page.
// * Rule Condition:
// - Must specify [Condition][query_terms].
// * Action Input: Request Query
// * Action Result: Redirects shopper to provided uri.
message RedirectAction {
// URL must have length equal or less than 2000 characters.
string redirect_uri = 1;
}

// Creates a set of terms that will be treated as synonyms of each other.
// Example: synonyms of "sneakers" and "shoes".
// * "sneakers" will use a synonym of "shoes".
// * "shoes" will use a synonym of "sneakers".
message TwowaySynonymsAction {
// Defines a set of synonyms.
// Can specify up to 100 synonyms.
// Must specify at least 2 synonyms.
repeated string synonyms = 1;
}

// Maps a set of terms to a set of synonyms.
// Set of synonyms will be treated as synonyms of each query term only.
// `query_terms` will not be treated as synonyms of each other.
// Example: "sneakers" will use a synonym of "shoes".
// "shoes" will not use a synonym of "sneakers".
message OnewaySynonymsAction {
// Terms from the search query.
// Will treat synonyms as their synonyms.
// Not themselves synonyms of the synonyms.
// Can specify up to 100 terms.
repeated string query_terms = 3;

// Defines a set of synonyms.
// Cannot contain duplicates.
// Can specify up to 100 synonyms.
repeated string synonyms = 4;

// Will be [deprecated = true] post migration;
repeated string oneway_terms = 2;
}

// Prevents `query_term` from being associated with specified terms during
// search.
// Example: Don't associate "gShoe" and "cheap".
message DoNotAssociateAction {
// Terms from the search query.
// Will not consider do_not_associate_terms for search if in search query.
// Can specify up to 100 terms.
repeated string query_terms = 2;

// Cannot contain duplicates or the query term.
// Can specify up to 100 terms.
repeated string do_not_associate_terms = 3;

// Will be [deprecated = true] post migration;
repeated string terms = 1;
}

// Replaces a term in the query. Multiple replacement candidates can be
// specified. All `query_terms` will be replaced with the replacement term.
// Example: Replace "gShoe" with "google shoe".
message ReplacementAction {
// Terms from the search query.
// Will be replaced by replacement term.
// Can specify up to 100 terms.
repeated string query_terms = 2;

// Term that will be used for replacement.
string replacement_term = 3;

// Will be [deprecated = true] post migration;
string term = 1;
}

// Prevents a term in the query from being used in search.
// Example: Don't search for "shoddy".
message IgnoreAction {
// Terms to ignore in the search query.
repeated string ignore_terms = 1;
}

// An action must be provided.
oneof action {
// A boost action.
BoostAction boost_action = 2;

// Redirects a shopper to a specific page.
RedirectAction redirect_action = 3;

// Treats specific term as a synonym with a group of terms.
// Group of terms will not be treated as synonyms with the specific term.
OnewaySynonymsAction oneway_synonyms_action = 6;

// Prevents term from being associated with other terms.
DoNotAssociateAction do_not_associate_action = 7;

// Replaces specific terms in the query.
ReplacementAction replacement_action = 8;

// Ignores specific terms from query during search.
IgnoreAction ignore_action = 9;

// Filters results.
FilterAction filter_action = 10;

// Treats a set of terms as synonyms of one another.
TwowaySynonymsAction twoway_synonyms_action = 11;
}

// Required. The condition that triggers the rule.
// If the condition is empty, the rule will always apply.
Condition condition = 1 [(google.api.field_behavior) = REQUIRED];
}

// An intended audience of the [Product][google.cloud.retail.v2alpha.Product]
// for whom it's sold.
message Audience {
Expand Down Expand Up @@ -100,10 +343,6 @@ message CustomAttribute {
// The textual values of this custom attribute. For example, `["yellow",
// "green"]` when the key is "color".
//
// At most 400 values are allowed. Empty values are not allowed. Each value
// must be a UTF-8 encoded string with a length limit of 256 characters.
// Otherwise, an INVALID_ARGUMENT error is returned.
//
// Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
// [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
// set. Otherwise, an INVALID_ARGUMENT error is returned.
Expand All @@ -112,9 +351,6 @@ message CustomAttribute {
// The numerical values of this custom attribute. For example, `[2.3, 15.4]`
// when the key is "lengths_cm".
//
// At most 400 values are allowed.Otherwise, an INVALID_ARGUMENT error is
// returned.
//
// Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
// [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
// set. Otherwise, an INVALID_ARGUMENT error is returned.
Expand Down Expand Up @@ -281,7 +517,7 @@ message PriceInfo {
//
// Google Merchant Center property
// [price](https://support.google.com/merchants/answer/6324371). Schema.org
// property [Offer.priceSpecification](https://schema.org/priceSpecification).
// property [Offer.price](https://schema.org/price).
float price = 2;

// Price of the product without any discount. If zero, by default set to be
Expand Down Expand Up @@ -447,16 +683,21 @@ message LocalInventory {

// Additional local inventory attributes, for example, store name, promotion
// tags, etc.
// * At most 5 values are allowed. Otherwise, an INVALID_ARGUMENT error is
// returned.
// * The key must be a UTF-8 encoded string with a length limit of 10
//
// This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
// error is returned:
//
// * At most 30 attributes are allowed.
// * The key must be a UTF-8 encoded string with a length limit of 32
// characters.
// * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
// key0LikeThis or KEY_1_LIKE_THIS.
// * The attribute values must be of the same type (text or number).
// * The max number of values per attribute is 10.
// * For text values, the length limit is 10 UTF-8 characters.
// * For text values, the length limit is 256 UTF-8 characters.
// * The attribute does not support search. The `searchable` field should be
// unset or set to false.
// * The max summed total bytes of custom attribute keys and values per
// product is 5MiB.
map<string, CustomAttribute> attributes = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ message GcsSource {
// [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
// * `user_event_ga360`: Using
// https://support.google.com/analytics/answer/3437719.
//
// Supported values for control imports:
//
// * 'control' (default): One JSON
// [Control][google.cloud.retail.v2alpha.Control] per line.
//
// Supported values for catalog attribute imports:
//
// * 'catalog_attribute' (default): One CSV
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
string data_schema = 2;
}

Expand Down
Loading

0 comments on commit 1e20e28

Please sign in to comment.