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