|
| 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'); |
0 commit comments