matching_function.proto 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.ads.googleads.v8.common;
  16. import "google/ads/googleads/v8/enums/matching_function_context_type.proto";
  17. import "google/ads/googleads/v8/enums/matching_function_operator.proto";
  18. import "google/api/annotations.proto";
  19. option csharp_namespace = "Google.Ads.GoogleAds.V8.Common";
  20. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v8/common;common";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "MatchingFunctionProto";
  23. option java_package = "com.google.ads.googleads.v8.common";
  24. option objc_class_prefix = "GAA";
  25. option php_namespace = "Google\\Ads\\GoogleAds\\V8\\Common";
  26. option ruby_package = "Google::Ads::GoogleAds::V8::Common";
  27. // Proto file describing a matching function.
  28. // Matching function associated with a
  29. // CustomerFeed, CampaignFeed, or AdGroupFeed. The matching function is used
  30. // to filter the set of feed items selected.
  31. message MatchingFunction {
  32. // String representation of the Function.
  33. //
  34. // Examples:
  35. //
  36. // 1. IDENTITY(true) or IDENTITY(false). All or no feed items served.
  37. // 2. EQUALS(CONTEXT.DEVICE,"Mobile")
  38. // 3. IN(FEED_ITEM_ID,{1000001,1000002,1000003})
  39. // 4. CONTAINS_ANY(FeedAttribute[12345678,0],{"Mars cruise","Venus cruise"})
  40. // 5. AND(IN(FEED_ITEM_ID,{10001,10002}),EQUALS(CONTEXT.DEVICE,"Mobile"))
  41. //
  42. // For more details, visit
  43. // https://developers.google.com/adwords/api/docs/guides/feed-matching-functions
  44. //
  45. // Note that because multiple strings may represent the same underlying
  46. // function (whitespace and single versus double quotation marks, for
  47. // example), the value returned may not be identical to the string sent in a
  48. // mutate request.
  49. optional string function_string = 5;
  50. // Operator for a function.
  51. google.ads.googleads.v8.enums.MatchingFunctionOperatorEnum.MatchingFunctionOperator operator = 4;
  52. // The operands on the left hand side of the equation. This is also the
  53. // operand to be used for single operand expressions such as NOT.
  54. repeated Operand left_operands = 2;
  55. // The operands on the right hand side of the equation.
  56. repeated Operand right_operands = 3;
  57. }
  58. // An operand in a matching function.
  59. message Operand {
  60. // A constant operand in a matching function.
  61. message ConstantOperand {
  62. // Constant operand values. Required.
  63. oneof constant_operand_value {
  64. // String value of the operand if it is a string type.
  65. string string_value = 5;
  66. // Int64 value of the operand if it is a int64 type.
  67. int64 long_value = 6;
  68. // Boolean value of the operand if it is a boolean type.
  69. bool boolean_value = 7;
  70. // Double value of the operand if it is a double type.
  71. double double_value = 8;
  72. }
  73. }
  74. // A feed attribute operand in a matching function.
  75. // Used to represent a feed attribute in feed.
  76. message FeedAttributeOperand {
  77. // The associated feed. Required.
  78. optional int64 feed_id = 3;
  79. // Id of the referenced feed attribute. Required.
  80. optional int64 feed_attribute_id = 4;
  81. }
  82. // A function operand in a matching function.
  83. // Used to represent nested functions.
  84. message FunctionOperand {
  85. // The matching function held in this operand.
  86. MatchingFunction matching_function = 1;
  87. }
  88. // An operand in a function referring to a value in the request context.
  89. message RequestContextOperand {
  90. // Type of value to be referred in the request context.
  91. google.ads.googleads.v8.enums.MatchingFunctionContextTypeEnum.MatchingFunctionContextType context_type = 1;
  92. }
  93. // Different operands that can be used in a matching function. Required.
  94. oneof function_argument_operand {
  95. // A constant operand in a matching function.
  96. ConstantOperand constant_operand = 1;
  97. // This operand specifies a feed attribute in feed.
  98. FeedAttributeOperand feed_attribute_operand = 2;
  99. // A function operand in a matching function.
  100. // Used to represent nested functions.
  101. FunctionOperand function_operand = 3;
  102. // An operand in a function referring to a value in the request context.
  103. RequestContextOperand request_context_operand = 4;
  104. }
  105. }