control.proto 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.v2alpha;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/retail/v2alpha/common.proto";
  19. import "google/cloud/retail/v2alpha/search_service.proto";
  20. option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ControlProto";
  24. option java_package = "com.google.cloud.retail.v2alpha";
  25. option objc_class_prefix = "RETAIL";
  26. option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
  27. option ruby_package = "Google::Cloud::Retail::V2alpha";
  28. // Configures dynamic serving time metadata that is used to pre and post
  29. // process search/recommendation model results.
  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 facet specification to perform faceted search.
  42. SearchRequest.FacetSpec facet_spec = 3;
  43. // A rule control - a condition-action pair.
  44. // Enacts a set action when the condition is triggered.
  45. // For example: Boost "gShoe" when query full matches "Running Shoes".
  46. Rule rule = 4;
  47. }
  48. // Immutable. Fully qualified name
  49. // `projects/*/locations/global/catalogs/*/controls/*`
  50. string name = 1 [(google.api.field_behavior) = IMMUTABLE];
  51. // Required. The human readable control display name. Used in Retail UI.
  52. //
  53. // This field must be a UTF-8 encoded string with a length limit of 128
  54. // characters. Otherwise, an INVALID_ARGUMENT error is thrown.
  55. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  56. // Output only. List of serving configuration ids that that are associated
  57. // with this control. Note the association is managed via the ServingConfig,
  58. // this is an output only denormalizeed view. Assumed to be in the same
  59. // catalog.
  60. repeated string associated_serving_config_ids = 5
  61. [(google.api.field_behavior) = OUTPUT_ONLY];
  62. // Required. Immutable. The solution types that the serving config is used
  63. // for. Currently we support setting only one type of solution at creation
  64. // time.
  65. //
  66. // Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
  67. // If no solution type is provided at creation time, will default to
  68. // SOLUTION_TYPE_SEARCH.
  69. repeated SolutionType solution_types = 6 [
  70. (google.api.field_behavior) = REQUIRED,
  71. (google.api.field_behavior) = IMMUTABLE
  72. ];
  73. // Required. Specifies the use case for the control.
  74. // Affects what condition fields can be set.
  75. // Only settable by search controls.
  76. // Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified.
  77. // Currently only allow one search_solution_use_case per control.
  78. repeated SearchSolutionUseCase search_solution_use_case = 7
  79. [(google.api.field_behavior) = REQUIRED];
  80. }