diff --git a/DeveloperConnect/metadata/V1/DeveloperConnect.php b/DeveloperConnect/metadata/V1/DeveloperConnect.php index be6683bdc38f..5ace8341f90b 100644 Binary files a/DeveloperConnect/metadata/V1/DeveloperConnect.php and b/DeveloperConnect/metadata/V1/DeveloperConnect.php differ diff --git a/DeveloperConnect/src/V1/Client/DeveloperConnectClient.php b/DeveloperConnect/src/V1/Client/DeveloperConnectClient.php index 46718be4a797..625be6c6a0c4 100644 --- a/DeveloperConnect/src/V1/Client/DeveloperConnectClient.php +++ b/DeveloperConnect/src/V1/Client/DeveloperConnectClient.php @@ -205,6 +205,27 @@ public static function connectionName(string $project, string $location, string ]); } + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * git_repository_link resource. @@ -266,14 +287,37 @@ public static function secretVersionName(string $project, string $secret, string ]); } + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $namespace, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + /** * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern * - connection: projects/{project}/locations/{location}/connections/{connection} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} * - gitRepositoryLink: projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link} * - location: projects/{project}/locations/{location} * - secretVersion: projects/{project}/secrets/{secret}/versions/{secret_version} + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} * * The optional $template argument can be supplied to specify a particular pattern, * and must match one of the templates listed above. If no $template argument is diff --git a/DeveloperConnect/src/V1/Connection.php b/DeveloperConnect/src/V1/Connection.php index 4ecfb1749656..7348efe72383 100644 --- a/DeveloperConnect/src/V1/Connection.php +++ b/DeveloperConnect/src/V1/Connection.php @@ -88,6 +88,13 @@ class Connection extends \Google\Protobuf\Internal\Message * Generated from protobuf field string uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { */ protected $uid = ''; + /** + * Optional. The crypto key configuration. This field is used by the + * Customer-Managed Encryption Keys (CMEK) feature. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.CryptoKeyConfig crypto_key_config = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $crypto_key_config = null; protected $connection_config; /** @@ -98,6 +105,12 @@ class Connection extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\DeveloperConnect\V1\GitHubConfig $github_config * Configuration for connections to github.com. + * @type \Google\Cloud\DeveloperConnect\V1\GitHubEnterpriseConfig $github_enterprise_config + * Configuration for connections to an instance of GitHub Enterprise. + * @type \Google\Cloud\DeveloperConnect\V1\GitLabConfig $gitlab_config + * Configuration for connections to gitlab.com. + * @type \Google\Cloud\DeveloperConnect\V1\GitLabEnterpriseConfig $gitlab_enterprise_config + * Configuration for connections to an instance of GitLab Enterprise. * @type string $name * Identifier. The resource name of the connection, in the format * `projects/{project}/locations/{location}/connections/{connection_id}`. @@ -127,6 +140,9 @@ class Connection extends \Google\Protobuf\Internal\Message * @type string $uid * Output only. A system-assigned unique identifier for a the * GitRepositoryLink. + * @type \Google\Cloud\DeveloperConnect\V1\CryptoKeyConfig $crypto_key_config + * Optional. The crypto key configuration. This field is used by the + * Customer-Managed Encryption Keys (CMEK) feature. * } */ public function __construct($data = NULL) { @@ -165,6 +181,99 @@ public function setGithubConfig($var) return $this; } + /** + * Configuration for connections to an instance of GitHub Enterprise. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubEnterpriseConfig github_enterprise_config = 13; + * @return \Google\Cloud\DeveloperConnect\V1\GitHubEnterpriseConfig|null + */ + public function getGithubEnterpriseConfig() + { + return $this->readOneof(13); + } + + public function hasGithubEnterpriseConfig() + { + return $this->hasOneof(13); + } + + /** + * Configuration for connections to an instance of GitHub Enterprise. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubEnterpriseConfig github_enterprise_config = 13; + * @param \Google\Cloud\DeveloperConnect\V1\GitHubEnterpriseConfig $var + * @return $this + */ + public function setGithubEnterpriseConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitHubEnterpriseConfig::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Configuration for connections to gitlab.com. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitLabConfig gitlab_config = 14; + * @return \Google\Cloud\DeveloperConnect\V1\GitLabConfig|null + */ + public function getGitlabConfig() + { + return $this->readOneof(14); + } + + public function hasGitlabConfig() + { + return $this->hasOneof(14); + } + + /** + * Configuration for connections to gitlab.com. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitLabConfig gitlab_config = 14; + * @param \Google\Cloud\DeveloperConnect\V1\GitLabConfig $var + * @return $this + */ + public function setGitlabConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitLabConfig::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Configuration for connections to an instance of GitLab Enterprise. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitLabEnterpriseConfig gitlab_enterprise_config = 16; + * @return \Google\Cloud\DeveloperConnect\V1\GitLabEnterpriseConfig|null + */ + public function getGitlabEnterpriseConfig() + { + return $this->readOneof(16); + } + + public function hasGitlabEnterpriseConfig() + { + return $this->hasOneof(16); + } + + /** + * Configuration for connections to an instance of GitLab Enterprise. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitLabEnterpriseConfig gitlab_enterprise_config = 16; + * @param \Google\Cloud\DeveloperConnect\V1\GitLabEnterpriseConfig $var + * @return $this + */ + public function setGitlabEnterpriseConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitLabEnterpriseConfig::class); + $this->writeOneof(16, $var); + + return $this; + } + /** * Identifier. The resource name of the connection, in the format * `projects/{project}/locations/{location}/connections/{connection_id}`. @@ -505,6 +614,44 @@ public function setUid($var) return $this; } + /** + * Optional. The crypto key configuration. This field is used by the + * Customer-Managed Encryption Keys (CMEK) feature. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.CryptoKeyConfig crypto_key_config = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DeveloperConnect\V1\CryptoKeyConfig|null + */ + public function getCryptoKeyConfig() + { + return $this->crypto_key_config; + } + + public function hasCryptoKeyConfig() + { + return isset($this->crypto_key_config); + } + + public function clearCryptoKeyConfig() + { + unset($this->crypto_key_config); + } + + /** + * Optional. The crypto key configuration. This field is used by the + * Customer-Managed Encryption Keys (CMEK) feature. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.CryptoKeyConfig crypto_key_config = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DeveloperConnect\V1\CryptoKeyConfig $var + * @return $this + */ + public function setCryptoKeyConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\CryptoKeyConfig::class); + $this->crypto_key_config = $var; + + return $this; + } + /** * @return string */ diff --git a/DeveloperConnect/src/V1/CryptoKeyConfig.php b/DeveloperConnect/src/V1/CryptoKeyConfig.php new file mode 100644 index 000000000000..6f6c00bb8f28 --- /dev/null +++ b/DeveloperConnect/src/V1/CryptoKeyConfig.php @@ -0,0 +1,76 @@ +google.cloud.developerconnect.v1.CryptoKeyConfig + */ +class CryptoKeyConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the key which is used to encrypt/decrypt customer + * data. For key in Cloud KMS, the key should be in the format of + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string key_reference = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $key_reference = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key_reference + * Required. The name of the key which is used to encrypt/decrypt customer + * data. For key in Cloud KMS, the key should be in the format of + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the key which is used to encrypt/decrypt customer + * data. For key in Cloud KMS, the key should be in the format of + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string key_reference = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getKeyReference() + { + return $this->key_reference; + } + + /** + * Required. The name of the key which is used to encrypt/decrypt customer + * data. For key in Cloud KMS, the key should be in the format of + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string key_reference = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKeyReference($var) + { + GPBUtil::checkString($var, True); + $this->key_reference = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/GitHubEnterpriseConfig.php b/DeveloperConnect/src/V1/GitHubEnterpriseConfig.php new file mode 100644 index 000000000000..3b7ef1009b17 --- /dev/null +++ b/DeveloperConnect/src/V1/GitHubEnterpriseConfig.php @@ -0,0 +1,411 @@ +google.cloud.developerconnect.v1.GitHubEnterpriseConfig + */ +class GitHubEnterpriseConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI of the GitHub Enterprise host this connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $host_uri = ''; + /** + * Optional. ID of the GitHub App created from the manifest. + * + * Generated from protobuf field int64 app_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_id = 0; + /** + * Output only. The URL-friendly name of the GitHub App. + * + * Generated from protobuf field string app_slug = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $app_slug = ''; + /** + * Optional. SecretManager resource containing the private key of the GitHub + * App, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string private_key_secret_version = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $private_key_secret_version = ''; + /** + * Optional. SecretManager resource containing the webhook secret of the + * GitHub App, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $webhook_secret_secret_version = ''; + /** + * Optional. ID of the installation of the GitHub App. + * + * Generated from protobuf field int64 app_installation_id = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_installation_id = 0; + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubEnterpriseConfig. + * + * Generated from protobuf field string installation_uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $installation_uri = ''; + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitHub Enterprise server. This should only be set if the GitHub + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitHub Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_directory_config = null; + /** + * Output only. GitHub Enterprise version installed at the host_uri. + * + * Generated from protobuf field string server_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $server_version = ''; + /** + * Optional. SSL certificate to use for requests to GitHub Enterprise. + * + * Generated from protobuf field string ssl_ca_certificate = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_ca_certificate = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_uri + * Required. The URI of the GitHub Enterprise host this connection is for. + * @type int|string $app_id + * Optional. ID of the GitHub App created from the manifest. + * @type string $app_slug + * Output only. The URL-friendly name of the GitHub App. + * @type string $private_key_secret_version + * Optional. SecretManager resource containing the private key of the GitHub + * App, formatted as `projects/*/secrets/*/versions/*`. + * @type string $webhook_secret_secret_version + * Optional. SecretManager resource containing the webhook secret of the + * GitHub App, formatted as `projects/*/secrets/*/versions/*`. + * @type int|string $app_installation_id + * Optional. ID of the installation of the GitHub App. + * @type string $installation_uri + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubEnterpriseConfig. + * @type \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig $service_directory_config + * Optional. Configuration for using Service Directory to privately connect to + * a GitHub Enterprise server. This should only be set if the GitHub + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitHub Enterprise + * server will be made over the public internet. + * @type string $server_version + * Output only. GitHub Enterprise version installed at the host_uri. + * @type string $ssl_ca_certificate + * Optional. SSL certificate to use for requests to GitHub Enterprise. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI of the GitHub Enterprise host 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 GitHub Enterprise host 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; + } + + /** + * Optional. ID of the GitHub App created from the manifest. + * + * Generated from protobuf field int64 app_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getAppId() + { + return $this->app_id; + } + + /** + * Optional. ID of the GitHub App created from the manifest. + * + * Generated from protobuf field int64 app_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setAppId($var) + { + GPBUtil::checkInt64($var); + $this->app_id = $var; + + return $this; + } + + /** + * Output only. The URL-friendly name of the GitHub App. + * + * Generated from protobuf field string app_slug = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAppSlug() + { + return $this->app_slug; + } + + /** + * Output only. The URL-friendly name of the GitHub App. + * + * Generated from protobuf field string app_slug = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAppSlug($var) + { + GPBUtil::checkString($var, True); + $this->app_slug = $var; + + return $this; + } + + /** + * Optional. SecretManager resource containing the private key of the GitHub + * App, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string private_key_secret_version = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getPrivateKeySecretVersion() + { + return $this->private_key_secret_version; + } + + /** + * Optional. SecretManager resource containing the private key of the GitHub + * App, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string private_key_secret_version = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setPrivateKeySecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->private_key_secret_version = $var; + + return $this; + } + + /** + * Optional. SecretManager resource containing the webhook secret of the + * GitHub App, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getWebhookSecretSecretVersion() + { + return $this->webhook_secret_secret_version; + } + + /** + * Optional. SecretManager resource containing the webhook secret of the + * GitHub App, formatted as `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string webhook_secret_secret_version = 5 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + + /** + * Optional. ID of the installation of the GitHub App. + * + * Generated from protobuf field int64 app_installation_id = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getAppInstallationId() + { + return $this->app_installation_id; + } + + /** + * Optional. ID of the installation of the GitHub App. + * + * Generated from protobuf field int64 app_installation_id = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setAppInstallationId($var) + { + GPBUtil::checkInt64($var); + $this->app_installation_id = $var; + + return $this; + } + + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubEnterpriseConfig. + * + * Generated from protobuf field string installation_uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getInstallationUri() + { + return $this->installation_uri; + } + + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubEnterpriseConfig. + * + * Generated from protobuf field string installation_uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setInstallationUri($var) + { + GPBUtil::checkString($var, True); + $this->installation_uri = $var; + + return $this; + } + + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitHub Enterprise server. This should only be set if the GitHub + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitHub Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DeveloperConnect\V1\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 GitHub Enterprise server. This should only be set if the GitHub + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitHub Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig $var + * @return $this + */ + public function setServiceDirectoryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig::class); + $this->service_directory_config = $var; + + return $this; + } + + /** + * Output only. GitHub Enterprise version installed at the host_uri. + * + * Generated from protobuf field string server_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServerVersion() + { + return $this->server_version; + } + + /** + * Output only. GitHub Enterprise version installed at the host_uri. + * + * Generated from protobuf field string server_version = 12 [(.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; + } + + /** + * Optional. SSL certificate to use for requests to GitHub Enterprise. + * + * Generated from protobuf field string ssl_ca_certificate = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSslCaCertificate() + { + return $this->ssl_ca_certificate; + } + + /** + * Optional. SSL certificate to use for requests to GitHub Enterprise. + * + * Generated from protobuf field string ssl_ca_certificate = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSslCaCertificate($var) + { + GPBUtil::checkString($var, True); + $this->ssl_ca_certificate = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/GitLabConfig.php b/DeveloperConnect/src/V1/GitLabConfig.php new file mode 100644 index 000000000000..c3086e630f68 --- /dev/null +++ b/DeveloperConnect/src/V1/GitLabConfig.php @@ -0,0 +1,187 @@ +google.cloud.developerconnect.v1.GitLabConfig + */ +class GitLabConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $webhook_secret_secret_version = ''; + /** + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $read_authorizer_credential = null; + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $authorizer_credential = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $webhook_secret_secret_version + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * @type \Google\Cloud\DeveloperConnect\V1\UserCredential $read_authorizer_credential + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * @type \Google\Cloud\DeveloperConnect\V1\UserCredential $authorizer_credential + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 1 [(.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 + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 1 [(.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 GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\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 GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\UserCredential $var + * @return $this + */ + public function setReadAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\UserCredential::class); + $this->read_authorizer_credential = $var; + + return $this; + } + + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\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 GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\UserCredential $var + * @return $this + */ + public function setAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\UserCredential::class); + $this->authorizer_credential = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/GitLabEnterpriseConfig.php b/DeveloperConnect/src/V1/GitLabEnterpriseConfig.php new file mode 100644 index 000000000000..24b0389f9a38 --- /dev/null +++ b/DeveloperConnect/src/V1/GitLabEnterpriseConfig.php @@ -0,0 +1,357 @@ +google.cloud.developerconnect.v1.GitLabEnterpriseConfig + */ +class GitLabEnterpriseConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI of the GitLab Enterprise host this connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $host_uri = ''; + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $webhook_secret_secret_version = ''; + /** + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $read_authorizer_credential = null; + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $authorizer_credential = null; + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitLab Enterprise instance. This should only be set if the GitLab + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitLab Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_directory_config = null; + /** + * Optional. SSL Certificate Authority certificate to use for requests to + * GitLab Enterprise instance. + * + * Generated from protobuf field string ssl_ca_certificate = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_ca_certificate = ''; + /** + * Output only. Version of the GitLab Enterprise server running on the + * `host_uri`. + * + * Generated from protobuf field string server_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $server_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_uri + * Required. The URI of the GitLab Enterprise host this connection is for. + * @type string $webhook_secret_secret_version + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * @type \Google\Cloud\DeveloperConnect\V1\UserCredential $read_authorizer_credential + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * @type \Google\Cloud\DeveloperConnect\V1\UserCredential $authorizer_credential + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * @type \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig $service_directory_config + * Optional. Configuration for using Service Directory to privately connect to + * a GitLab Enterprise instance. This should only be set if the GitLab + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitLab Enterprise + * server will be made over the public internet. + * @type string $ssl_ca_certificate + * Optional. SSL Certificate Authority certificate to use for requests to + * GitLab Enterprise instance. + * @type string $server_version + * Output only. Version of the GitLab Enterprise server running on the + * `host_uri`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI of the GitLab Enterprise host 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 GitLab Enterprise host 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 + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * 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 + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * 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 GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\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 GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\UserCredential $var + * @return $this + */ + public function setReadAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\UserCredential::class); + $this->read_authorizer_credential = $var; + + return $this; + } + + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\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 GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\UserCredential $var + * @return $this + */ + public function setAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\UserCredential::class); + $this->authorizer_credential = $var; + + return $this; + } + + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitLab Enterprise instance. This should only be set if the GitLab + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitLab Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DeveloperConnect\V1\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 GitLab Enterprise instance. This should only be set if the GitLab + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitLab Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig $var + * @return $this + */ + public function setServiceDirectoryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig::class); + $this->service_directory_config = $var; + + return $this; + } + + /** + * Optional. SSL Certificate Authority certificate to use for requests to + * GitLab Enterprise instance. + * + * Generated from protobuf field string ssl_ca_certificate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSslCaCertificate() + { + return $this->ssl_ca_certificate; + } + + /** + * Optional. SSL Certificate Authority certificate to use for requests to + * GitLab Enterprise instance. + * + * Generated from protobuf field string ssl_ca_certificate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSslCaCertificate($var) + { + GPBUtil::checkString($var, True); + $this->ssl_ca_certificate = $var; + + return $this; + } + + /** + * Output only. Version of the GitLab Enterprise server 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 GitLab Enterprise server 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/DeveloperConnect/src/V1/GitRepositoryLink.php b/DeveloperConnect/src/V1/GitRepositoryLink.php index 028d0e8e9227..30bf0e2cfd17 100644 --- a/DeveloperConnect/src/V1/GitRepositoryLink.php +++ b/DeveloperConnect/src/V1/GitRepositoryLink.php @@ -80,6 +80,12 @@ class GitRepositoryLink extends \Google\Protobuf\Internal\Message * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { */ protected $uid = ''; + /** + * Output only. External ID of the webhook created for the repository. + * + * Generated from protobuf field string webhook_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $webhook_id = ''; /** * Constructor. @@ -112,6 +118,8 @@ class GitRepositoryLink extends \Google\Protobuf\Internal\Message * @type string $uid * Output only. A system-assigned unique identifier for a the * GitRepositoryLink. + * @type string $webhook_id + * Output only. External ID of the webhook created for the repository. * } */ public function __construct($data = NULL) { @@ -419,5 +427,31 @@ public function setUid($var) return $this; } + /** + * Output only. External ID of the webhook created for the repository. + * + * Generated from protobuf field string webhook_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getWebhookId() + { + return $this->webhook_id; + } + + /** + * Output only. External ID of the webhook created for the repository. + * + * Generated from protobuf field string webhook_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setWebhookId($var) + { + GPBUtil::checkString($var, True); + $this->webhook_id = $var; + + return $this; + } + } diff --git a/DeveloperConnect/src/V1/OperationMetadata.php b/DeveloperConnect/src/V1/OperationMetadata.php index 97c6dd80fd06..230685d22900 100644 --- a/DeveloperConnect/src/V1/OperationMetadata.php +++ b/DeveloperConnect/src/V1/OperationMetadata.php @@ -48,9 +48,10 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -81,9 +82,10 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * @type bool $requested_cancellation * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. * @type string $api_version * Output only. API version used to start the operation. * } @@ -246,9 +248,10 @@ public function setStatusMessage($var) /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return bool @@ -261,9 +264,10 @@ public function getRequestedCancellation() /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have been cancelled successfully - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param bool $var diff --git a/DeveloperConnect/src/V1/ServiceDirectoryConfig.php b/DeveloperConnect/src/V1/ServiceDirectoryConfig.php new file mode 100644 index 000000000000..53b99355e074 --- /dev/null +++ b/DeveloperConnect/src/V1/ServiceDirectoryConfig.php @@ -0,0 +1,76 @@ +google.cloud.developerconnect.v1.ServiceDirectoryConfig + */ +class ServiceDirectoryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Service Directory service name. + * Format: + * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * Required. The Service Directory service name. + * Format: + * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Service Directory service name. + * Format: + * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Required. The Service Directory service name. + * Format: + * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/UserCredential.php b/DeveloperConnect/src/V1/UserCredential.php new file mode 100644 index 000000000000..e8fa67e225e2 --- /dev/null +++ b/DeveloperConnect/src/V1/UserCredential.php @@ -0,0 +1,110 @@ +google.cloud.developerconnect.v1.UserCredential + */ +class UserCredential extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A SecretManager resource containing the user token that + * authorizes the Developer Connect connection. Format: + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string user_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $user_token_secret_version = ''; + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $user_token_secret_version + * Required. A SecretManager resource containing the user token that + * authorizes the Developer Connect connection. Format: + * `projects/*/secrets/*/versions/*`. + * @type string $username + * Output only. The username associated with this token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. A SecretManager resource containing the user token that + * authorizes the Developer Connect connection. Format: + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string user_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getUserTokenSecretVersion() + { + return $this->user_token_secret_version; + } + + /** + * Required. A SecretManager resource containing the user token that + * authorizes the Developer Connect connection. Format: + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string user_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setUserTokenSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->user_token_secret_version = $var; + + return $this; + } + + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/resources/developer_connect_descriptor_config.php b/DeveloperConnect/src/V1/resources/developer_connect_descriptor_config.php index 798b2cd088fb..a0ff262b35ef 100644 --- a/DeveloperConnect/src/V1/resources/developer_connect_descriptor_config.php +++ b/DeveloperConnect/src/V1/resources/developer_connect_descriptor_config.php @@ -295,9 +295,11 @@ ], 'templateMap' => [ 'connection' => 'projects/{project}/locations/{location}/connections/{connection}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', 'gitRepositoryLink' => 'projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}', 'location' => 'projects/{project}/locations/{location}', 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{secret_version}', + 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', ], ], ], diff --git a/DeveloperConnect/tests/Unit/V1/Client/DeveloperConnectClientTest.php b/DeveloperConnect/tests/Unit/V1/Client/DeveloperConnectClientTest.php index 196bff7e617b..d89c03961815 100644 --- a/DeveloperConnect/tests/Unit/V1/Client/DeveloperConnectClientTest.php +++ b/DeveloperConnect/tests/Unit/V1/Client/DeveloperConnectClientTest.php @@ -267,12 +267,14 @@ public function createGitRepositoryLinkTest() $etag = 'etag3123477'; $reconciling = false; $uid = 'uid115792'; + $webhookId = 'webhookId311874531'; $expectedResponse = new GitRepositoryLink(); $expectedResponse->setName($name); $expectedResponse->setCloneUri($cloneUri); $expectedResponse->setEtag($etag); $expectedResponse->setReconciling($reconciling); $expectedResponse->setUid($uid); + $expectedResponse->setWebhookId($webhookId); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1117,12 +1119,14 @@ public function getGitRepositoryLinkTest() $etag = 'etag3123477'; $reconciling = false; $uid = 'uid115792'; + $webhookId = 'webhookId311874531'; $expectedResponse = new GitRepositoryLink(); $expectedResponse->setName($name2); $expectedResponse->setCloneUri($cloneUri); $expectedResponse->setEtag($etag); $expectedResponse->setReconciling($reconciling); $expectedResponse->setUid($uid); + $expectedResponse->setWebhookId($webhookId); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->gitRepositoryLinkName(