From 852254d61b93d0cd28b1e45f8e26d2180f6e2aee Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 14:04:36 +0530 Subject: [PATCH] feat: Add Bitbucket Data Center Config and Bitbucket Cloud config for Cloud Build Repositories (#7147) PiperOrigin-RevId: 615470832 Source-Link: https://github.com/googleapis/googleapis/commit/98cbc7d41f2b7cc875549a4ad417717f0bdccd81 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c056f3f76c7a883f6cb23ccecbce33986651c5c7 Copy-Tag: eyJwIjoiQnVpbGQvLk93bEJvdC55YW1sIiwiaCI6ImMwNTZmM2Y3NmM3YTg4M2Y2Y2IyM2NjZWNiY2UzMzk4NjY1MWM1YzcifQ== --- Build/metadata/V2/Repositories.php | Bin 11019 -> 12102 bytes Build/src/V2/BitbucketCloudConfig.php | 217 ++++++++++++++ Build/src/V2/BitbucketDataCenterConfig.php | 333 +++++++++++++++++++++ Build/src/V2/Connection.php | 70 ++++- 4 files changed, 618 insertions(+), 2 deletions(-) create mode 100644 Build/src/V2/BitbucketCloudConfig.php create mode 100644 Build/src/V2/BitbucketDataCenterConfig.php diff --git a/Build/metadata/V2/Repositories.php b/Build/metadata/V2/Repositories.php index d409e662716cf4f9a6a979425ba2af46f2a5da52..0c64b207d04f966227ab0f73112e877bd46c69f5 100644 GIT binary patch delta 358 zcmeAUI~KR$8PmjBV%#y#Ir*h2Nu`-NDU%;EYHfbT#K*|8J(SB}qPM|h4VDRvdK10n zxRMcyHnQ|E-DTfw&sxl=p1>uOlv$Egnw*_l5}%S-k{F+ynpcuq6rY@*mzJ3>!J)vY z!EIzQIZ;mD)(NK21*py$tjrm#%7Z~DluHa@4%jZ337lXPj6o*w!A$@=dGkuPo$TVL znYkq4;s}!`b8^dVzQn`D$P^PZ`7Up`loRsaa{;sF2e1dTof4@WO#lz3 diff --git a/Build/src/V2/BitbucketCloudConfig.php b/Build/src/V2/BitbucketCloudConfig.php new file mode 100644 index 00000000000..d526163a795 --- /dev/null +++ b/Build/src/V2/BitbucketCloudConfig.php @@ -0,0 +1,217 @@ +google.devtools.cloudbuild.v2.BitbucketCloudConfig + */ +class BitbucketCloudConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud + * Platform. + * + * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $workspace = ''; + /** + * Required. SecretManager resource containing the webhook secret used to + * verify webhook events, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $webhook_secret_secret_version = ''; + /** + * Required. An access token with the `repository` access. It can be either a + * workspace, project or repository access token. It's recommended to use a + * system account to generate the credentials. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $read_authorizer_credential = null; + /** + * Required. An access token with the `webhook`, `repository`, + * `repository:admin` and `pullrequest` scope access. It can be either a + * workspace, project or repository access token. It's recommended to use a + * system account to generate these credentials. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $authorizer_credential = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $workspace + * Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud + * Platform. + * @type string $webhook_secret_secret_version + * Required. SecretManager resource containing the webhook secret used to + * verify webhook events, formatted as `projects/*/secrets/*/versions/*`. + * @type \Google\Cloud\Build\V2\UserCredential $read_authorizer_credential + * Required. An access token with the `repository` access. It can be either a + * workspace, project or repository access token. It's recommended to use a + * system account to generate the credentials. + * @type \Google\Cloud\Build\V2\UserCredential $authorizer_credential + * Required. An access token with the `webhook`, `repository`, + * `repository:admin` and `pullrequest` scope access. It can be either a + * workspace, project or repository access token. It's recommended to use a + * system account to generate these credentials. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudbuild\V2\Repositories::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud + * Platform. + * + * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getWorkspace() + { + return $this->workspace; + } + + /** + * Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud + * Platform. + * + * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setWorkspace($var) + { + GPBUtil::checkString($var, True); + $this->workspace = $var; + + return $this; + } + + /** + * Required. SecretManager resource containing the webhook secret used to + * verify webhook events, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getWebhookSecretSecretVersion() + { + return $this->webhook_secret_secret_version; + } + + /** + * Required. SecretManager resource containing the webhook secret used to + * verify webhook events, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWebhookSecretSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->webhook_secret_secret_version = $var; + + return $this; + } + + /** + * Required. An access token with the `repository` access. It can be either a + * workspace, project or repository access token. It's recommended to use a + * system account to generate the credentials. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Build\V2\UserCredential|null + */ + public function getReadAuthorizerCredential() + { + return $this->read_authorizer_credential; + } + + public function hasReadAuthorizerCredential() + { + return isset($this->read_authorizer_credential); + } + + public function clearReadAuthorizerCredential() + { + unset($this->read_authorizer_credential); + } + + /** + * Required. An access token with the `repository` access. It can be either a + * workspace, project or repository access token. It's recommended to use a + * system account to generate the credentials. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Build\V2\UserCredential $var + * @return $this + */ + public function setReadAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Build\V2\UserCredential::class); + $this->read_authorizer_credential = $var; + + return $this; + } + + /** + * Required. An access token with the `webhook`, `repository`, + * `repository:admin` and `pullrequest` scope access. It can be either a + * workspace, project or repository access token. It's recommended to use a + * system account to generate these credentials. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Build\V2\UserCredential|null + */ + public function getAuthorizerCredential() + { + return $this->authorizer_credential; + } + + public function hasAuthorizerCredential() + { + return isset($this->authorizer_credential); + } + + public function clearAuthorizerCredential() + { + unset($this->authorizer_credential); + } + + /** + * Required. An access token with the `webhook`, `repository`, + * `repository:admin` and `pullrequest` scope access. It can be either a + * workspace, project or repository access token. It's recommended to use a + * system account to generate these credentials. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Build\V2\UserCredential $var + * @return $this + */ + public function setAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Build\V2\UserCredential::class); + $this->authorizer_credential = $var; + + return $this; + } + +} + diff --git a/Build/src/V2/BitbucketDataCenterConfig.php b/Build/src/V2/BitbucketDataCenterConfig.php new file mode 100644 index 00000000000..f35711f64d1 --- /dev/null +++ b/Build/src/V2/BitbucketDataCenterConfig.php @@ -0,0 +1,333 @@ +google.devtools.cloudbuild.v2.BitbucketDataCenterConfig + */ +class BitbucketDataCenterConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI of the Bitbucket Data Center instance or cluster this + * connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $host_uri = ''; + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * used to verify webhook events, formatted as + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + private $webhook_secret_secret_version = ''; + /** + * Required. A http access token with the `REPO_READ` access. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $read_authorizer_credential = null; + /** + * Required. A http access token with the `REPO_ADMIN` scope access. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $authorizer_credential = null; + /** + * Optional. Configuration for using Service Directory to privately connect to + * a Bitbucket Data Center. This should only be set if the Bitbucket Data + * Center is hosted on-premises and not reachable by public internet. If this + * field is left empty, calls to the Bitbucket Data Center will be made over + * the public internet. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $service_directory_config = null; + /** + * Optional. SSL certificate to use for requests to the Bitbucket Data Center. + * + * Generated from protobuf field string ssl_ca = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ssl_ca = ''; + /** + * Output only. Version of the Bitbucket Data Center running on the + * `host_uri`. + * + * Generated from protobuf field string server_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $server_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_uri + * Required. The URI of the Bitbucket Data Center instance or cluster this + * connection is for. + * @type string $webhook_secret_secret_version + * Required. Immutable. SecretManager resource containing the webhook secret + * used to verify webhook events, formatted as + * `projects/*/secrets/*/versions/*`. + * @type \Google\Cloud\Build\V2\UserCredential $read_authorizer_credential + * Required. A http access token with the `REPO_READ` access. + * @type \Google\Cloud\Build\V2\UserCredential $authorizer_credential + * Required. A http access token with the `REPO_ADMIN` scope access. + * @type \Google\Cloud\Build\V2\ServiceDirectoryConfig $service_directory_config + * Optional. Configuration for using Service Directory to privately connect to + * a Bitbucket Data Center. This should only be set if the Bitbucket Data + * Center is hosted on-premises and not reachable by public internet. If this + * field is left empty, calls to the Bitbucket Data Center will be made over + * the public internet. + * @type string $ssl_ca + * Optional. SSL certificate to use for requests to the Bitbucket Data Center. + * @type string $server_version + * Output only. Version of the Bitbucket Data Center running on the + * `host_uri`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Cloudbuild\V2\Repositories::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI of the Bitbucket Data Center instance or cluster this + * connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHostUri() + { + return $this->host_uri; + } + + /** + * Required. The URI of the Bitbucket Data Center instance or cluster this + * connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHostUri($var) + { + GPBUtil::checkString($var, True); + $this->host_uri = $var; + + return $this; + } + + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * used to verify webhook events, formatted as + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getWebhookSecretSecretVersion() + { + return $this->webhook_secret_secret_version; + } + + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * used to verify webhook events, formatted as + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWebhookSecretSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->webhook_secret_secret_version = $var; + + return $this; + } + + /** + * Required. A http access token with the `REPO_READ` access. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Build\V2\UserCredential|null + */ + public function getReadAuthorizerCredential() + { + return $this->read_authorizer_credential; + } + + public function hasReadAuthorizerCredential() + { + return isset($this->read_authorizer_credential); + } + + public function clearReadAuthorizerCredential() + { + unset($this->read_authorizer_credential); + } + + /** + * Required. A http access token with the `REPO_READ` access. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Build\V2\UserCredential $var + * @return $this + */ + public function setReadAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Build\V2\UserCredential::class); + $this->read_authorizer_credential = $var; + + return $this; + } + + /** + * Required. A http access token with the `REPO_ADMIN` scope access. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Build\V2\UserCredential|null + */ + public function getAuthorizerCredential() + { + return $this->authorizer_credential; + } + + public function hasAuthorizerCredential() + { + return isset($this->authorizer_credential); + } + + public function clearAuthorizerCredential() + { + unset($this->authorizer_credential); + } + + /** + * Required. A http access token with the `REPO_ADMIN` scope access. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Build\V2\UserCredential $var + * @return $this + */ + public function setAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Build\V2\UserCredential::class); + $this->authorizer_credential = $var; + + return $this; + } + + /** + * Optional. Configuration for using Service Directory to privately connect to + * a Bitbucket Data Center. This should only be set if the Bitbucket Data + * Center is hosted on-premises and not reachable by public internet. If this + * field is left empty, calls to the Bitbucket Data Center will be made over + * the public internet. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Build\V2\ServiceDirectoryConfig|null + */ + public function getServiceDirectoryConfig() + { + return $this->service_directory_config; + } + + public function hasServiceDirectoryConfig() + { + return isset($this->service_directory_config); + } + + public function clearServiceDirectoryConfig() + { + unset($this->service_directory_config); + } + + /** + * Optional. Configuration for using Service Directory to privately connect to + * a Bitbucket Data Center. This should only be set if the Bitbucket Data + * Center is hosted on-premises and not reachable by public internet. If this + * field is left empty, calls to the Bitbucket Data Center will be made over + * the public internet. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Build\V2\ServiceDirectoryConfig $var + * @return $this + */ + public function setServiceDirectoryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Build\V2\ServiceDirectoryConfig::class); + $this->service_directory_config = $var; + + return $this; + } + + /** + * Optional. SSL certificate to use for requests to the Bitbucket Data Center. + * + * Generated from protobuf field string ssl_ca = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSslCa() + { + return $this->ssl_ca; + } + + /** + * Optional. SSL certificate to use for requests to the Bitbucket Data Center. + * + * Generated from protobuf field string ssl_ca = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSslCa($var) + { + GPBUtil::checkString($var, True); + $this->ssl_ca = $var; + + return $this; + } + + /** + * Output only. Version of the Bitbucket Data Center running on the + * `host_uri`. + * + * Generated from protobuf field string server_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServerVersion() + { + return $this->server_version; + } + + /** + * Output only. Version of the Bitbucket Data Center running on the + * `host_uri`. + * + * Generated from protobuf field string server_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServerVersion($var) + { + GPBUtil::checkString($var, True); + $this->server_version = $var; + + return $this; + } + +} + diff --git a/Build/src/V2/Connection.php b/Build/src/V2/Connection.php index a194cd5adb6..ece4f99a1a1 100644 --- a/Build/src/V2/Connection.php +++ b/Build/src/V2/Connection.php @@ -9,8 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Server or - * GitLab. + * A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center, + * Bitbucket Cloud or GitLab. * * Generated from protobuf message google.devtools.cloudbuild.v2.Connection */ @@ -92,6 +92,10 @@ class Connection extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Build\V2\GitLabConfig $gitlab_config * Configuration for connections to gitlab.com or an instance of GitLab * Enterprise. + * @type \Google\Cloud\Build\V2\BitbucketDataCenterConfig $bitbucket_data_center_config + * Configuration for connections to Bitbucket Data Center. + * @type \Google\Cloud\Build\V2\BitbucketCloudConfig $bitbucket_cloud_config + * Configuration for connections to Bitbucket Cloud. * @type \Google\Cloud\Build\V2\InstallationState $installation_state * Output only. Installation state of the Connection. * @type bool $disabled @@ -309,6 +313,68 @@ public function setGitlabConfig($var) return $this; } + /** + * Configuration for connections to Bitbucket Data Center. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.BitbucketDataCenterConfig bitbucket_data_center_config = 8; + * @return \Google\Cloud\Build\V2\BitbucketDataCenterConfig|null + */ + public function getBitbucketDataCenterConfig() + { + return $this->readOneof(8); + } + + public function hasBitbucketDataCenterConfig() + { + return $this->hasOneof(8); + } + + /** + * Configuration for connections to Bitbucket Data Center. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.BitbucketDataCenterConfig bitbucket_data_center_config = 8; + * @param \Google\Cloud\Build\V2\BitbucketDataCenterConfig $var + * @return $this + */ + public function setBitbucketDataCenterConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Build\V2\BitbucketDataCenterConfig::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Configuration for connections to Bitbucket Cloud. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.BitbucketCloudConfig bitbucket_cloud_config = 9; + * @return \Google\Cloud\Build\V2\BitbucketCloudConfig|null + */ + public function getBitbucketCloudConfig() + { + return $this->readOneof(9); + } + + public function hasBitbucketCloudConfig() + { + return $this->hasOneof(9); + } + + /** + * Configuration for connections to Bitbucket Cloud. + * + * Generated from protobuf field .google.devtools.cloudbuild.v2.BitbucketCloudConfig bitbucket_cloud_config = 9; + * @param \Google\Cloud\Build\V2\BitbucketCloudConfig $var + * @return $this + */ + public function setBitbucketCloudConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Build\V2\BitbucketCloudConfig::class); + $this->writeOneof(9, $var); + + return $this; + } + /** * Output only. Installation state of the Connection. *