policy.proto 8.8 KB

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