policy.proto 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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.v6.common;
  16. import "google/ads/googleads/v6/enums/policy_topic_entry_type.proto";
  17. import "google/ads/googleads/v6/enums/policy_topic_evidence_destination_mismatch_url_type.proto";
  18. import "google/ads/googleads/v6/enums/policy_topic_evidence_destination_not_working_device.proto";
  19. import "google/ads/googleads/v6/enums/policy_topic_evidence_destination_not_working_dns_error_type.proto";
  20. import "google/api/annotations.proto";
  21. option csharp_namespace = "Google.Ads.GoogleAds.V6.Common";
  22. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v6/common;common";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "PolicyProto";
  25. option java_package = "com.google.ads.googleads.v6.common";
  26. option objc_class_prefix = "GAA";
  27. option php_namespace = "Google\\Ads\\GoogleAds\\V6\\Common";
  28. option ruby_package = "Google::Ads::GoogleAds::V6::Common";
  29. // Proto file describing policy information.
  30. // Key of the violation. The key is used for referring to a violation
  31. // when filing an exemption request.
  32. message PolicyViolationKey {
  33. // Unique ID of the violated policy.
  34. optional string policy_name = 3;
  35. // The text that violates the policy if specified.
  36. // Otherwise, refers to the policy in general
  37. // (e.g., when requesting to be exempt from the whole policy).
  38. // If not specified for criterion exemptions, the whole policy is implied.
  39. // Must be specified for ad exemptions.
  40. optional string violating_text = 4;
  41. }
  42. // Parameter for controlling how policy exemption is done. Ignorable policy
  43. // topics are only usable with expanded text ads and responsive search ads. All
  44. // other ad types must use policy violation keys.
  45. message PolicyValidationParameter {
  46. // The list of policy topics that should not cause a PolicyFindingError to
  47. // be reported. This field is currently only compatible with Enhanced Text Ad.
  48. // It corresponds to the PolicyTopicEntry.topic field.
  49. //
  50. // Resources violating these policies will be saved, but will not be eligible
  51. // to serve. They may begin serving at a later time due to a change in
  52. // policies, re-review of the resource, or a change in advertiser
  53. // certificates.
  54. repeated string ignorable_policy_topics = 3;
  55. // The list of policy violation keys that should not cause a
  56. // PolicyViolationError to be reported. Not all policy violations are
  57. // exemptable, please refer to the is_exemptible field in the returned
  58. // PolicyViolationError.
  59. //
  60. // Resources violating these polices will be saved, but will not be eligible
  61. // to serve. They may begin serving at a later time due to a change in
  62. // policies, re-review of the resource, or a change in advertiser
  63. // certificates.
  64. repeated PolicyViolationKey exempt_policy_violation_keys = 2;
  65. }
  66. // Policy finding attached to a resource (e.g. alcohol policy associated with
  67. // a site that sells alcohol).
  68. //
  69. // Each PolicyTopicEntry has a topic that indicates the specific ads policy
  70. // the entry is about and a type to indicate the effect that the entry will have
  71. // on serving. It may optionally have one or more evidences that indicate the
  72. // reason for the finding. It may also optionally have one or more constraints
  73. // that provide details about how serving may be restricted.
  74. message PolicyTopicEntry {
  75. // Policy topic this finding refers to. For example, "ALCOHOL",
  76. // "TRADEMARKS_IN_AD_TEXT", or "DESTINATION_NOT_WORKING". The set of possible
  77. // policy topics is not fixed for a particular API version and may change
  78. // at any time.
  79. optional string topic = 5;
  80. // Describes the negative or positive effect this policy will have on serving.
  81. google.ads.googleads.v6.enums.PolicyTopicEntryTypeEnum.PolicyTopicEntryType type = 2;
  82. // Additional information that explains policy finding
  83. // (e.g. the brand name for a trademark finding).
  84. repeated PolicyTopicEvidence evidences = 3;
  85. // Indicates how serving of this resource may be affected (e.g. not serving
  86. // in a country).
  87. repeated PolicyTopicConstraint constraints = 4;
  88. }
  89. // Additional information that explains a policy finding.
  90. message PolicyTopicEvidence {
  91. // A list of fragments of text that violated a policy.
  92. message TextList {
  93. // The fragments of text from the resource that caused the policy finding.
  94. repeated string texts = 2;
  95. }
  96. // A list of websites that caused a policy finding. Used for
  97. // ONE_WEBSITE_PER_AD_GROUP policy topic, for example. In case there are more
  98. // than five websites, only the top five (those that appear in resources the
  99. // most) will be listed here.
  100. message WebsiteList {
  101. // Websites that caused the policy finding.
  102. repeated string websites = 2;
  103. }
  104. // A list of strings found in a destination page that caused a policy
  105. // finding.
  106. message DestinationTextList {
  107. // List of text found in the resource's destination page.
  108. repeated string destination_texts = 2;
  109. }
  110. // Evidence of mismatches between the URLs of a resource.
  111. message DestinationMismatch {
  112. // The set of URLs that did not match each other.
  113. repeated google.ads.googleads.v6.enums.PolicyTopicEvidenceDestinationMismatchUrlTypeEnum.PolicyTopicEvidenceDestinationMismatchUrlType url_types = 1;
  114. }
  115. // Evidence details when the destination is returning an HTTP error
  116. // code or isn't functional in all locations for commonly used devices.
  117. message DestinationNotWorking {
  118. // The full URL that didn't work.
  119. optional string expanded_url = 7;
  120. // The type of device that failed to load the URL.
  121. google.ads.googleads.v6.enums.PolicyTopicEvidenceDestinationNotWorkingDeviceEnum.PolicyTopicEvidenceDestinationNotWorkingDevice device = 4;
  122. // The time the URL was last checked.
  123. // The format is "YYYY-MM-DD HH:MM:SS".
  124. // Examples: "2018-03-05 09:15:00" or "2018-02-01 14:34:30"
  125. optional string last_checked_date_time = 8;
  126. // Indicates the reason of the DESTINATION_NOT_WORKING policy finding.
  127. oneof reason {
  128. // The type of DNS error.
  129. google.ads.googleads.v6.enums.PolicyTopicEvidenceDestinationNotWorkingDnsErrorTypeEnum.PolicyTopicEvidenceDestinationNotWorkingDnsErrorType dns_error_type = 1;
  130. // The HTTP error code.
  131. int64 http_error_code = 6;
  132. }
  133. }
  134. // Specific evidence information depending on the evidence type.
  135. oneof value {
  136. // List of websites linked with this resource.
  137. WebsiteList website_list = 3;
  138. // List of evidence found in the text of a resource.
  139. TextList text_list = 4;
  140. // The language the resource was detected to be written in.
  141. // This is an IETF language tag such as "en-US".
  142. string language_code = 9;
  143. // The text in the destination of the resource that is causing a policy
  144. // finding.
  145. DestinationTextList destination_text_list = 6;
  146. // Mismatch between the destinations of a resource's URLs.
  147. DestinationMismatch destination_mismatch = 7;
  148. // Details when the destination is returning an HTTP error code or isn't
  149. // functional in all locations for commonly used devices.
  150. DestinationNotWorking destination_not_working = 8;
  151. }
  152. }
  153. // Describes the effect on serving that a policy topic entry will have.
  154. message PolicyTopicConstraint {
  155. // A list of countries where a resource's serving is constrained.
  156. message CountryConstraintList {
  157. // Total number of countries targeted by the resource.
  158. optional int32 total_targeted_countries = 3;
  159. // Countries in which serving is restricted.
  160. repeated CountryConstraint countries = 2;
  161. }
  162. // Indicates that a policy topic was constrained due to disapproval of the
  163. // website for reseller purposes.
  164. message ResellerConstraint {
  165. }
  166. // Indicates that a resource's ability to serve in a particular country is
  167. // constrained.
  168. message CountryConstraint {
  169. // Geo target constant resource name of the country in which serving is
  170. // constrained.
  171. optional string country_criterion = 2;
  172. }
  173. // Specific information about the constraint.
  174. oneof value {
  175. // Countries where the resource cannot serve.
  176. CountryConstraintList country_constraint_list = 1;
  177. // Reseller constraint.
  178. ResellerConstraint reseller_constraint = 2;
  179. // Countries where a certificate is required for serving.
  180. CountryConstraintList certificate_missing_in_country_list = 3;
  181. // Countries where the resource's domain is not covered by the
  182. // certificates associated with it.
  183. CountryConstraintList certificate_domain_mismatch_in_country_list = 4;
  184. }
  185. }