matching_function.proto 4.6 KB

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