control.proto 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.retail.v2;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/retail/v2/common.proto";
  19. option csharp_namespace = "Google.Cloud.Retail.V2";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ControlProto";
  23. option java_package = "com.google.cloud.retail.v2";
  24. option objc_class_prefix = "RETAIL";
  25. option php_namespace = "Google\\Cloud\\Retail\\V2";
  26. option ruby_package = "Google::Cloud::Retail::V2";
  27. // Configures dynamic metadata that can be linked to a
  28. // [ServingConfig][google.cloud.retail.v2.ServingConfig] and affect search or
  29. // recommendation results at serving time.
  30. message Control {
  31. option (google.api.resource) = {
  32. type: "retail.googleapis.com/Control"
  33. pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}"
  34. };
  35. // The behavior/type of the control
  36. //
  37. // A behavior/type must be specified on creation. Type cannot be changed once
  38. // specified (e.g. A Rule control will always be a Rule control.). An
  39. // INVALID_ARGUMENT will be returned if either condition is violated.
  40. oneof control {
  41. // A rule control - a condition-action pair.
  42. // Enacts a set action when the condition is triggered.
  43. // For example: Boost "gShoe" when query full matches "Running Shoes".
  44. Rule rule = 4;
  45. }
  46. // Immutable. Fully qualified name
  47. // `projects/*/locations/global/catalogs/*/controls/*`
  48. string name = 1 [(google.api.field_behavior) = IMMUTABLE];
  49. // Required. The human readable control display name. Used in Retail UI.
  50. //
  51. // This field must be a UTF-8 encoded string with a length limit of 128
  52. // characters. Otherwise, an INVALID_ARGUMENT error is thrown.
  53. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  54. // Output only. List of [serving
  55. // configuration][google.cloud.retail.v2.ServingConfig] ids that are
  56. // associated with this control in the same
  57. // [Catalog][google.cloud.retail.v2.Catalog].
  58. //
  59. // Note the association is managed via the
  60. // [ServingConfig][google.cloud.retail.v2.ServingConfig], this is an output
  61. // only denormalized view.
  62. repeated string associated_serving_config_ids = 5
  63. [(google.api.field_behavior) = OUTPUT_ONLY];
  64. // Required. Immutable. The solution types that the control is used for.
  65. // Currently we support setting only one type of solution at creation time.
  66. //
  67. // Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
  68. // If no solution type is provided at creation time, will default to
  69. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH].
  70. repeated SolutionType solution_types = 6 [
  71. (google.api.field_behavior) = REQUIRED,
  72. (google.api.field_behavior) = IMMUTABLE
  73. ];
  74. // Specifies the use case for the control.
  75. // Affects what condition fields can be set.
  76. // Only settable by search controls.
  77. // Will default to
  78. // [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
  79. // if not specified. Currently only allow one search_solution_use_case per
  80. // control.
  81. repeated SearchSolutionUseCase search_solution_use_case = 7;
  82. }