control.proto 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.v2beta;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/retail/v2beta/common.proto";
  19. import "google/cloud/retail/v2beta/search_service.proto";
  20. option csharp_namespace = "Google.Cloud.Retail.V2Beta";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ControlProto";
  24. option java_package = "com.google.cloud.retail.v2beta";
  25. option objc_class_prefix = "RETAIL";
  26. option php_namespace = "Google\\Cloud\\Retail\\V2beta";
  27. option ruby_package = "Google::Cloud::Retail::V2beta";
  28. // Configures dynamic metadata that can be linked to a
  29. // [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and affect search
  30. // or recommendation results at serving time.
  31. message Control {
  32. option (google.api.resource) = {
  33. type: "retail.googleapis.com/Control"
  34. pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}"
  35. };
  36. // The behavior/type of the control
  37. //
  38. // A behavior/type must be specified on creation. Type cannot be changed once
  39. // specified (e.g. A Rule control will always be a Rule control.). An
  40. // INVALID_ARGUMENT will be returned if either condition is violated.
  41. oneof control {
  42. // A facet specification to perform faceted search.
  43. //
  44. // Note that this field is deprecated and will throw NOT_IMPLEMENTED if
  45. // used for creating a control.
  46. SearchRequest.FacetSpec facet_spec = 3 [deprecated = true];
  47. // A rule control - a condition-action pair.
  48. // Enacts a set action when the condition is triggered.
  49. // For example: Boost "gShoe" when query full matches "Running Shoes".
  50. Rule rule = 4;
  51. }
  52. // Immutable. Fully qualified name
  53. // `projects/*/locations/global/catalogs/*/controls/*`
  54. string name = 1 [(google.api.field_behavior) = IMMUTABLE];
  55. // Required. The human readable control display name. Used in Retail UI.
  56. //
  57. // This field must be a UTF-8 encoded string with a length limit of 128
  58. // characters. Otherwise, an INVALID_ARGUMENT error is thrown.
  59. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  60. // Output only. List of [serving
  61. // configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
  62. // associated with this control in the same
  63. // [Catalog][google.cloud.retail.v2beta.Catalog].
  64. //
  65. // Note the association is managed via the
  66. // [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
  67. // output only denormalized view.
  68. repeated string associated_serving_config_ids = 5
  69. [(google.api.field_behavior) = OUTPUT_ONLY];
  70. // Required. Immutable. The solution types that the control is used for.
  71. // Currently we support setting only one type of solution at creation time.
  72. //
  73. // Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
  74. // If no solution type is provided at creation time, will default to
  75. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
  76. repeated SolutionType solution_types = 6 [
  77. (google.api.field_behavior) = REQUIRED,
  78. (google.api.field_behavior) = IMMUTABLE
  79. ];
  80. // Specifies the use case for the control.
  81. // Affects what condition fields can be set.
  82. // Only settable by search controls.
  83. // Will default to
  84. // [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
  85. // if not specified. Currently only allow one search_solution_use_case per
  86. // control.
  87. repeated SearchSolutionUseCase search_solution_use_case = 7;
  88. }