Skip to content

Commit 4fed8bd

Browse files
1 parent 0f64338 commit 4fed8bd

10 files changed

+664
-1
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\DLP;
19+
20+
class GooglePrivacyDlpV2AdjustByImageFindings extends \Google\Collection
21+
{
22+
/**
23+
* Default value; same as POSSIBLE.
24+
*/
25+
public const MIN_LIKELIHOOD_LIKELIHOOD_UNSPECIFIED = 'LIKELIHOOD_UNSPECIFIED';
26+
/**
27+
* Highest chance of a false positive.
28+
*/
29+
public const MIN_LIKELIHOOD_VERY_UNLIKELY = 'VERY_UNLIKELY';
30+
/**
31+
* High chance of a false positive.
32+
*/
33+
public const MIN_LIKELIHOOD_UNLIKELY = 'UNLIKELY';
34+
/**
35+
* Some matching signals. The default value.
36+
*/
37+
public const MIN_LIKELIHOOD_POSSIBLE = 'POSSIBLE';
38+
/**
39+
* Low chance of a false positive.
40+
*/
41+
public const MIN_LIKELIHOOD_LIKELY = 'LIKELY';
42+
/**
43+
* Confidence level is high. Lowest chance of a false positive.
44+
*/
45+
public const MIN_LIKELIHOOD_VERY_LIKELY = 'VERY_LIKELY';
46+
protected $collection_key = 'infoTypes';
47+
protected $imageContainmentTypeType = GooglePrivacyDlpV2ImageContainmentType::class;
48+
protected $imageContainmentTypeDataType = '';
49+
protected $infoTypesType = GooglePrivacyDlpV2InfoType::class;
50+
protected $infoTypesDataType = 'array';
51+
/**
52+
* Required. Minimum likelihood of the `adjust_by_image_findings.info_types`
53+
* finding. If the likelihood is lower than this value, Sensitive Data
54+
* Protection doesn't adjust the likelihood of the
55+
* `InspectionRuleSet.info_types` finding.
56+
*
57+
* @var string
58+
*/
59+
public $minLikelihood;
60+
61+
/**
62+
* Specifies the required spatial relationship between the bounding boxes of
63+
* the target finding and the context infoType findings.
64+
*
65+
* @param GooglePrivacyDlpV2ImageContainmentType $imageContainmentType
66+
*/
67+
public function setImageContainmentType(GooglePrivacyDlpV2ImageContainmentType $imageContainmentType)
68+
{
69+
$this->imageContainmentType = $imageContainmentType;
70+
}
71+
/**
72+
* @return GooglePrivacyDlpV2ImageContainmentType
73+
*/
74+
public function getImageContainmentType()
75+
{
76+
return $this->imageContainmentType;
77+
}
78+
/**
79+
* A list of image-supported infoTypes—excluding [document
80+
* infoTypes](https://cloud.google.com/sensitive-data-
81+
* protection/docs/infotypes-reference#documents)—to be used as context for
82+
* the adjustment rule. Sensitive Data Protection adjusts the likelihood of an
83+
* image finding if its bounding box has the specified spatial relationship
84+
* (defined by `image_containment_type`) with a finding of an infoType in this
85+
* list. For example, you can create a rule to adjust the likelihood of a
86+
* `US_PASSPORT` finding if it is enclosed by a finding of
87+
* `OBJECT_TYPE/PERSON/PASSPORT`. To configure this, set `US_PASSPORT` in
88+
* `InspectionRuleSet.info_types`. Add an `adjustment_rule` with an
89+
* `adjust_by_image_findings.info_types` that contains
90+
* `OBJECT_TYPE/PERSON/PASSPORT` and `image_containment_type` set to
91+
* `encloses`. In this case, the likelihood of the `US_PASSPORT` finding is
92+
* adjusted, but the likelihood of the `OBJECT_TYPE/PERSON/PASSPORT` finding
93+
* is not.
94+
*
95+
* @param GooglePrivacyDlpV2InfoType[] $infoTypes
96+
*/
97+
public function setInfoTypes($infoTypes)
98+
{
99+
$this->infoTypes = $infoTypes;
100+
}
101+
/**
102+
* @return GooglePrivacyDlpV2InfoType[]
103+
*/
104+
public function getInfoTypes()
105+
{
106+
return $this->infoTypes;
107+
}
108+
/**
109+
* Required. Minimum likelihood of the `adjust_by_image_findings.info_types`
110+
* finding. If the likelihood is lower than this value, Sensitive Data
111+
* Protection doesn't adjust the likelihood of the
112+
* `InspectionRuleSet.info_types` finding.
113+
*
114+
* Accepted values: LIKELIHOOD_UNSPECIFIED, VERY_UNLIKELY, UNLIKELY, POSSIBLE,
115+
* LIKELY, VERY_LIKELY
116+
*
117+
* @param self::MIN_LIKELIHOOD_* $minLikelihood
118+
*/
119+
public function setMinLikelihood($minLikelihood)
120+
{
121+
$this->minLikelihood = $minLikelihood;
122+
}
123+
/**
124+
* @return self::MIN_LIKELIHOOD_*
125+
*/
126+
public function getMinLikelihood()
127+
{
128+
return $this->minLikelihood;
129+
}
130+
}
131+
132+
// Adding a class alias for backwards compatibility with the previous class name.
133+
class_alias(GooglePrivacyDlpV2AdjustByImageFindings::class, 'Google_Service_DLP_GooglePrivacyDlpV2AdjustByImageFindings');
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\DLP;
19+
20+
class GooglePrivacyDlpV2AdjustByMatchingInfoTypes extends \Google\Collection
21+
{
22+
/**
23+
* Invalid.
24+
*/
25+
public const MATCHING_TYPE_MATCHING_TYPE_UNSPECIFIED = 'MATCHING_TYPE_UNSPECIFIED';
26+
/**
27+
* Full match. - Dictionary: join of Dictionary results matched the complete
28+
* finding quote - Regex: all regex matches fill a finding quote from start to
29+
* end - Exclude infoType: completely inside affecting infoTypes findings
30+
*/
31+
public const MATCHING_TYPE_MATCHING_TYPE_FULL_MATCH = 'MATCHING_TYPE_FULL_MATCH';
32+
/**
33+
* Partial match. - Dictionary: at least one of the tokens in the finding
34+
* matches - Regex: substring of the finding matches - Exclude infoType:
35+
* intersects with affecting infoTypes findings
36+
*/
37+
public const MATCHING_TYPE_MATCHING_TYPE_PARTIAL_MATCH = 'MATCHING_TYPE_PARTIAL_MATCH';
38+
/**
39+
* Inverse match. - Dictionary: no tokens in the finding match the dictionary
40+
* - Regex: finding doesn't match the regex - Exclude infoType: no
41+
* intersection with affecting infoTypes findings
42+
*/
43+
public const MATCHING_TYPE_MATCHING_TYPE_INVERSE_MATCH = 'MATCHING_TYPE_INVERSE_MATCH';
44+
/**
45+
* Rule-specific match. The matching logic is based on the specific rule being
46+
* used. This is required for rules where the matching behavior is not a
47+
* simple string comparison (e.g., image containment). This matching type can
48+
* only be used with the `ExcludeByImageFindings` rule. - Exclude by image
49+
* findings: The matching logic is defined within `ExcludeByImageFindings`
50+
* based on spatial relationships between bounding boxes.
51+
*/
52+
public const MATCHING_TYPE_MATCHING_TYPE_RULE_SPECIFIC = 'MATCHING_TYPE_RULE_SPECIFIC';
53+
/**
54+
* Default value; same as POSSIBLE.
55+
*/
56+
public const MIN_LIKELIHOOD_LIKELIHOOD_UNSPECIFIED = 'LIKELIHOOD_UNSPECIFIED';
57+
/**
58+
* Highest chance of a false positive.
59+
*/
60+
public const MIN_LIKELIHOOD_VERY_UNLIKELY = 'VERY_UNLIKELY';
61+
/**
62+
* High chance of a false positive.
63+
*/
64+
public const MIN_LIKELIHOOD_UNLIKELY = 'UNLIKELY';
65+
/**
66+
* Some matching signals. The default value.
67+
*/
68+
public const MIN_LIKELIHOOD_POSSIBLE = 'POSSIBLE';
69+
/**
70+
* Low chance of a false positive.
71+
*/
72+
public const MIN_LIKELIHOOD_LIKELY = 'LIKELY';
73+
/**
74+
* Confidence level is high. Lowest chance of a false positive.
75+
*/
76+
public const MIN_LIKELIHOOD_VERY_LIKELY = 'VERY_LIKELY';
77+
protected $collection_key = 'infoTypes';
78+
protected $infoTypesType = GooglePrivacyDlpV2InfoType::class;
79+
protected $infoTypesDataType = 'array';
80+
/**
81+
* How the adjustment rule is applied. Only MATCHING_TYPE_PARTIAL_MATCH is
82+
* supported: - Partial match: adjusts the findings of infoTypes specified in
83+
* the inspection rule when they have a nonempty intersection with a finding
84+
* of an infoType specified in this adjustment rule.
85+
*
86+
* @var string
87+
*/
88+
public $matchingType;
89+
/**
90+
* Required. Minimum likelihood of the
91+
* `adjust_by_matching_info_types.info_types` finding. If the likelihood is
92+
* lower than this value, Sensitive Data Protection doesn't adjust the
93+
* likelihood of the `InspectionRuleSet.info_types` finding.
94+
*
95+
* @var string
96+
*/
97+
public $minLikelihood;
98+
99+
/**
100+
* Sensitive Data Protection adjusts the likelihood of a finding if that
101+
* finding also matches one of these infoTypes. For example, you can create a
102+
* rule to adjust the likelihood of a `PHONE_NUMBER` finding if the string is
103+
* found within a document that is classified as `DOCUMENT_TYPE/HR/RESUME`. To
104+
* configure this, set `PHONE_NUMBER` in `InspectionRuleSet.info_types`. Add
105+
* an `adjustment_rule` with an `adjust_by_matching_info_types.info_types`
106+
* that contains `DOCUMENT_TYPE/HR/RESUME`. In this case, the likelihood of
107+
* the `PHONE_NUMBER` finding is adjusted, but the likelihood of the
108+
* `DOCUMENT_TYPE/HR/RESUME` finding is not.
109+
*
110+
* @param GooglePrivacyDlpV2InfoType[] $infoTypes
111+
*/
112+
public function setInfoTypes($infoTypes)
113+
{
114+
$this->infoTypes = $infoTypes;
115+
}
116+
/**
117+
* @return GooglePrivacyDlpV2InfoType[]
118+
*/
119+
public function getInfoTypes()
120+
{
121+
return $this->infoTypes;
122+
}
123+
/**
124+
* How the adjustment rule is applied. Only MATCHING_TYPE_PARTIAL_MATCH is
125+
* supported: - Partial match: adjusts the findings of infoTypes specified in
126+
* the inspection rule when they have a nonempty intersection with a finding
127+
* of an infoType specified in this adjustment rule.
128+
*
129+
* Accepted values: MATCHING_TYPE_UNSPECIFIED, MATCHING_TYPE_FULL_MATCH,
130+
* MATCHING_TYPE_PARTIAL_MATCH, MATCHING_TYPE_INVERSE_MATCH,
131+
* MATCHING_TYPE_RULE_SPECIFIC
132+
*
133+
* @param self::MATCHING_TYPE_* $matchingType
134+
*/
135+
public function setMatchingType($matchingType)
136+
{
137+
$this->matchingType = $matchingType;
138+
}
139+
/**
140+
* @return self::MATCHING_TYPE_*
141+
*/
142+
public function getMatchingType()
143+
{
144+
return $this->matchingType;
145+
}
146+
/**
147+
* Required. Minimum likelihood of the
148+
* `adjust_by_matching_info_types.info_types` finding. If the likelihood is
149+
* lower than this value, Sensitive Data Protection doesn't adjust the
150+
* likelihood of the `InspectionRuleSet.info_types` finding.
151+
*
152+
* Accepted values: LIKELIHOOD_UNSPECIFIED, VERY_UNLIKELY, UNLIKELY, POSSIBLE,
153+
* LIKELY, VERY_LIKELY
154+
*
155+
* @param self::MIN_LIKELIHOOD_* $minLikelihood
156+
*/
157+
public function setMinLikelihood($minLikelihood)
158+
{
159+
$this->minLikelihood = $minLikelihood;
160+
}
161+
/**
162+
* @return self::MIN_LIKELIHOOD_*
163+
*/
164+
public function getMinLikelihood()
165+
{
166+
return $this->minLikelihood;
167+
}
168+
}
169+
170+
// Adding a class alias for backwards compatibility with the previous class name.
171+
class_alias(GooglePrivacyDlpV2AdjustByMatchingInfoTypes::class, 'Google_Service_DLP_GooglePrivacyDlpV2AdjustByMatchingInfoTypes');
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\DLP;
19+
20+
class GooglePrivacyDlpV2AdjustmentRule extends \Google\Model
21+
{
22+
protected $adjustByImageFindingsType = GooglePrivacyDlpV2AdjustByImageFindings::class;
23+
protected $adjustByImageFindingsDataType = '';
24+
protected $adjustByMatchingInfoTypesType = GooglePrivacyDlpV2AdjustByMatchingInfoTypes::class;
25+
protected $adjustByMatchingInfoTypesDataType = '';
26+
protected $likelihoodAdjustmentType = GooglePrivacyDlpV2LikelihoodAdjustment::class;
27+
protected $likelihoodAdjustmentDataType = '';
28+
29+
/**
30+
* AdjustmentRule condition for image findings.
31+
*
32+
* @param GooglePrivacyDlpV2AdjustByImageFindings $adjustByImageFindings
33+
*/
34+
public function setAdjustByImageFindings(GooglePrivacyDlpV2AdjustByImageFindings $adjustByImageFindings)
35+
{
36+
$this->adjustByImageFindings = $adjustByImageFindings;
37+
}
38+
/**
39+
* @return GooglePrivacyDlpV2AdjustByImageFindings
40+
*/
41+
public function getAdjustByImageFindings()
42+
{
43+
return $this->adjustByImageFindings;
44+
}
45+
/**
46+
* Set of infoTypes for which findings would affect this rule.
47+
*
48+
* @param GooglePrivacyDlpV2AdjustByMatchingInfoTypes $adjustByMatchingInfoTypes
49+
*/
50+
public function setAdjustByMatchingInfoTypes(GooglePrivacyDlpV2AdjustByMatchingInfoTypes $adjustByMatchingInfoTypes)
51+
{
52+
$this->adjustByMatchingInfoTypes = $adjustByMatchingInfoTypes;
53+
}
54+
/**
55+
* @return GooglePrivacyDlpV2AdjustByMatchingInfoTypes
56+
*/
57+
public function getAdjustByMatchingInfoTypes()
58+
{
59+
return $this->adjustByMatchingInfoTypes;
60+
}
61+
/**
62+
* Likelihood adjustment to apply to the infoType.
63+
*
64+
* @param GooglePrivacyDlpV2LikelihoodAdjustment $likelihoodAdjustment
65+
*/
66+
public function setLikelihoodAdjustment(GooglePrivacyDlpV2LikelihoodAdjustment $likelihoodAdjustment)
67+
{
68+
$this->likelihoodAdjustment = $likelihoodAdjustment;
69+
}
70+
/**
71+
* @return GooglePrivacyDlpV2LikelihoodAdjustment
72+
*/
73+
public function getLikelihoodAdjustment()
74+
{
75+
return $this->likelihoodAdjustment;
76+
}
77+
}
78+
79+
// Adding a class alias for backwards compatibility with the previous class name.
80+
class_alias(GooglePrivacyDlpV2AdjustmentRule::class, 'Google_Service_DLP_GooglePrivacyDlpV2AdjustmentRule');

0 commit comments

Comments
 (0)