From e11a647d15da701cef9e416486bb76b85864205a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 15:25:19 -0700 Subject: [PATCH] feat: [OrgPolicy] Deprecates AlternativePolicySpec (#5122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Deprecates AlternativePolicySpec PiperOrigin-RevId: 428897918 Source-Link: https://github.com/googleapis/googleapis/commit/bbb3c1f3baeab22cda73f3c2e86a088db5a747e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e29706ef2ea260d1c66037b05af1cd813afa7569 Copy-Tag: eyJwIjoiT3JnUG9saWN5Ly5Pd2xCb3QueWFtbCIsImgiOiJlMjk3MDZlZjJlYTI2MGQxYzY2MDM3YjA1YWYxY2Q4MTNhZmE3NTY5In0= * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- OrgPolicy/metadata/V2/Orgpolicy.php | Bin 5154 -> 5158 bytes OrgPolicy/src/V2/Constraint.php | 10 ++-- OrgPolicy/src/V2/Policy.php | 35 ++++++-------- OrgPolicy/src/V2/PolicySpec/PolicyRule.php | 52 +++++++++++++-------- 4 files changed, 52 insertions(+), 45 deletions(-) diff --git a/OrgPolicy/metadata/V2/Orgpolicy.php b/OrgPolicy/metadata/V2/Orgpolicy.php index e6950cd1856339147608498cf766015fe1682684..b780dccee0fbf087ecf7e871f5d150e4ef1b582d 100644 GIT binary patch delta 47 zcmV+~0MP%UD5fZ|t^)z3v#$dm0Rg#_&jeBdMUx^0K?_0x7y&w;0qQ}U0h1vLA+w7G FmkxLQ4yXVC delta 31 ncmZ3cu}EXXI%dX&o7XeTGcs.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3; + * Generated from protobuf field .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true]; + * @deprecated */ - private $alternate = null; + protected $alternate = null; /** * Constructor. @@ -67,10 +65,7 @@ class Policy extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\OrgPolicy\V2\PolicySpec $spec * Basic information about the Organization Policy. * @type \Google\Cloud\OrgPolicy\V2\AlternatePolicySpec $alternate - * An alternate policy configuration that will be used instead of the baseline - * policy configurations as determined by the launch. - * Currently the only way the launch can trigger the alternate configuration - * is via dry-run/darklaunch. + * Deprecated. * } */ public function __construct($data = NULL) { @@ -159,41 +154,41 @@ public function setSpec($var) } /** - * An alternate policy configuration that will be used instead of the baseline - * policy configurations as determined by the launch. - * Currently the only way the launch can trigger the alternate configuration - * is via dry-run/darklaunch. + * Deprecated. * - * Generated from protobuf field .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3; + * Generated from protobuf field .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true]; * @return \Google\Cloud\OrgPolicy\V2\AlternatePolicySpec|null + * @deprecated */ public function getAlternate() { + @trigger_error('alternate is deprecated.', E_USER_DEPRECATED); return $this->alternate; } public function hasAlternate() { + @trigger_error('alternate is deprecated.', E_USER_DEPRECATED); return isset($this->alternate); } public function clearAlternate() { + @trigger_error('alternate is deprecated.', E_USER_DEPRECATED); unset($this->alternate); } /** - * An alternate policy configuration that will be used instead of the baseline - * policy configurations as determined by the launch. - * Currently the only way the launch can trigger the alternate configuration - * is via dry-run/darklaunch. + * Deprecated. * - * Generated from protobuf field .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3; + * Generated from protobuf field .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true]; * @param \Google\Cloud\OrgPolicy\V2\AlternatePolicySpec $var * @return $this + * @deprecated */ public function setAlternate($var) { + @trigger_error('alternate is deprecated.', E_USER_DEPRECATED); GPBUtil::checkMessage($var, \Google\Cloud\OrgPolicy\V2\AlternatePolicySpec::class); $this->alternate = $var; diff --git a/OrgPolicy/src/V2/PolicySpec/PolicyRule.php b/OrgPolicy/src/V2/PolicySpec/PolicyRule.php index 1d2a3f37bf6..5f1611e7278 100644 --- a/OrgPolicy/src/V2/PolicySpec/PolicyRule.php +++ b/OrgPolicy/src/V2/PolicySpec/PolicyRule.php @@ -20,11 +20,14 @@ class PolicyRule extends \Google\Protobuf\Internal\Message * in the evaluation of the policy. When set, the `expression` field in * the `Expr' must include from 1 to 10 subexpressions, joined by the "||" * or "&&" operators. Each subexpression must be of the form - * "resource.matchLabels(key_name, value_name)", - * where key_name and value_name are the resource names for Label Keys - * and Values. These names are available from the Label Manager Service. An - * example expression is: - * "resource.matchLabels('labelKeys/123, 'labelValues/456')". + * "resource.matchTag('/tag_key_short_name, + * 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', + * 'tagValues/value_id')". where key_name and value_name are the resource + * names for Label Keys and Values. These names are available from the Tag + * Manager Service. An example expression is: + * "resource.matchTag('123456789/environment, + * 'prod')". or "resource.matchTagId('tagKeys/123', + * 'tagValues/456')". * * Generated from protobuf field .google.type.Expr condition = 5; */ @@ -55,11 +58,14 @@ class PolicyRule extends \Google\Protobuf\Internal\Message * in the evaluation of the policy. When set, the `expression` field in * the `Expr' must include from 1 to 10 subexpressions, joined by the "||" * or "&&" operators. Each subexpression must be of the form - * "resource.matchLabels(key_name, value_name)", - * where key_name and value_name are the resource names for Label Keys - * and Values. These names are available from the Label Manager Service. An - * example expression is: - * "resource.matchLabels('labelKeys/123, 'labelValues/456')". + * "resource.matchTag('/tag_key_short_name, + * 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', + * 'tagValues/value_id')". where key_name and value_name are the resource + * names for Label Keys and Values. These names are available from the Tag + * Manager Service. An example expression is: + * "resource.matchTag('123456789/environment, + * 'prod')". or "resource.matchTagId('tagKeys/123', + * 'tagValues/456')". * } */ public function __construct($data = NULL) { @@ -206,11 +212,14 @@ public function setEnforce($var) * in the evaluation of the policy. When set, the `expression` field in * the `Expr' must include from 1 to 10 subexpressions, joined by the "||" * or "&&" operators. Each subexpression must be of the form - * "resource.matchLabels(key_name, value_name)", - * where key_name and value_name are the resource names for Label Keys - * and Values. These names are available from the Label Manager Service. An - * example expression is: - * "resource.matchLabels('labelKeys/123, 'labelValues/456')". + * "resource.matchTag('/tag_key_short_name, + * 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', + * 'tagValues/value_id')". where key_name and value_name are the resource + * names for Label Keys and Values. These names are available from the Tag + * Manager Service. An example expression is: + * "resource.matchTag('123456789/environment, + * 'prod')". or "resource.matchTagId('tagKeys/123', + * 'tagValues/456')". * * Generated from protobuf field .google.type.Expr condition = 5; * @return \Google\Type\Expr|null @@ -235,11 +244,14 @@ public function clearCondition() * in the evaluation of the policy. When set, the `expression` field in * the `Expr' must include from 1 to 10 subexpressions, joined by the "||" * or "&&" operators. Each subexpression must be of the form - * "resource.matchLabels(key_name, value_name)", - * where key_name and value_name are the resource names for Label Keys - * and Values. These names are available from the Label Manager Service. An - * example expression is: - * "resource.matchLabels('labelKeys/123, 'labelValues/456')". + * "resource.matchTag('/tag_key_short_name, + * 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', + * 'tagValues/value_id')". where key_name and value_name are the resource + * names for Label Keys and Values. These names are available from the Tag + * Manager Service. An example expression is: + * "resource.matchTag('123456789/environment, + * 'prod')". or "resource.matchTagId('tagKeys/123', + * 'tagValues/456')". * * Generated from protobuf field .google.type.Expr condition = 5; * @param \Google\Type\Expr $var