policy.proto 8.8 KB

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